• <noscript id="ecgc0"><kbd id="ecgc0"></kbd></noscript>
    <menu id="ecgc0"></menu>
  • <tt id="ecgc0"></tt>

    Word基本技巧

    有很多人剛接觸WORD的新手,經常會碰到的問題就是如何刪除頁眉頁腳,當然一個Word里面刪除頁眉頁腳不難,但有幾百多個Word里面都有頁眉頁腳要你刪除,那就難到不少人了,下面將針對這一問題,看看我是怎么操縱宏批量刪除多個Word頁眉頁腳,我獻丑了

    東西/原料

    • 運行情況WinXP/Vista/Win7/Win8
    • Word2003

    方式/步調

    1. 1

      假如我手上有500個word文檔需要刪除頁眉頁腳

    2. 2

      先把需要刪除頁眉頁腳的500個word文檔放在一個文件夾下,然后打開此中一個文檔

    3. 3

      在打開的文檔中,選擇在“東西”菜單中選擇“宏”--“宏”

    4. 4

      隨后彈出“宏”對話框,在宏名中輸入"Application",最后點擊"建立"按鈕

    5. 5

      隨后彈出“Microsoft visual basic”設計,在編纂處輸入如下代碼

      Sub 批量刪除Word頁眉頁腳()

        Application.ScreenUpdating = False

        Dim MyPath As String, i As Integer, myDoc As Document

        With Application.FileDialog(msoFileDialogFolderPicker)

          .Title = "選摘要處置方針文件夾" & "——(刪除里面所有Word文檔的頁眉頁腳)"

          If .Show = -1 Then

            MyPath = .SelectedItems(1)

          Else

            Exit Sub

          End If

        End With

        With Application.FileSearch

          .LookIn = MyPath

          .FileType = msoFileTypeWordDocuments

          If .Exeen

            For i = 1 To .FoundFiles.Count

              Set myDoc = Documents.Open(FileName:=.FoundFiles(i))

            ' B可以替代的宏

      ' 以下是處置格局所錄制的宏,可按照所需錄制

      If ActiveWindow.View.SplitSpecial <> wdPaneNone Then

              ActiveWindow.Panes(2).Close

          End If

          If ActiveWindow.ActivveWindow.ActivePane.View.Type = wdPrintView

          End If

          ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader

          Selection.WholeStory

          Selection.Delete Unit:=wdCharacter, Count:=1

          Selection.WholeStory

          With Selection.ParagraphFormat

              .Borders(wdBorderLeft).LineStyle = wdLineStyleNone

              .Borders(wdBorderRight).LineStyle = wdLineStyleNone

              .Borders(wdBorderTop).LineStyle = wdLineStyleNone

              .Borders(wdBorderBottom).LineStyle = wdLineStyleNone

              With .Borders

                  .DistanceFromTop = 1

                  .DistanceFromLeft = 4

                  .DistanceFromBottom = 1

                  .DistanceFromRight = 4

                  .Shadow = False

              End With

          End With

          With Options

              .DefaultBorderLineStyle = wdLineStyleSingle

              .DefaultBorderLineWidth = wdLineWidth075pt

              .DefaultBorderColor = wdColorAutomatic

          End With

          If Selection.HeaderFooter.IsHeader = True Then

              ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter

          Else

              ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader

          End If

          Selection.WholeStory

          Selection.Delete Unit:=wdCharacter, Count:=1

          geNumbers.Add PageNumberAlignment:= _

              wdAlignPageNumberRight, FirstPage:=True

      ' 以上可以換當作是你本身錄制的宏

      ' C公共部門的代碼

      Application.DisplayAlerts = False '強制執行“是”

      'ActiveDocument.Saved = True'強制執行“否”

      ActiveDocument.Close '退出

            Next

          End If

        End With

        Application.ScreenUpdating = True

        MsgBox "所選Word文檔的頁眉頁腳已刪除!!!", 64, "☆★批量處置完畢★☆"

      End Sub

      Sub ConvertEqns()

      '

      ' ConvertEqns Macro

      ' 宏在 2014-6-25 由 USER 建立

      '

      End Sub

    6. 6

      輸入代碼后,封閉窗口返回文檔,從頭選擇在“東西”菜單中選擇“宏”--“宏”,在彈出的宏名中選擇"批量刪除Word頁眉頁腳",最后點擊“運行”---確認即可快速地刪除500個Word頁眉頁腳

    • 發表于 2019-11-12 20:00
    • 閱讀 ( 669 )
    • 分類:其他類型

    你可能感興趣的文章

    相關問題

    0 條評論

    請先 登錄 后評論
    聯系我們:uytrv@hotmail.com 問答工具
  • <noscript id="ecgc0"><kbd id="ecgc0"></kbd></noscript>
    <menu id="ecgc0"></menu>
  • <tt id="ecgc0"></tt>
    久久久久精品国产麻豆