精品丰满熟女一区二区三区_五月天亚洲欧美综合网_亚洲青青青在线观看_国产一区二区精选

  • <menu id="29e66"></menu>

    <bdo id="29e66"><mark id="29e66"><legend id="29e66"></legend></mark></bdo>

  • <pre id="29e66"><tt id="29e66"><rt id="29e66"></rt></tt></pre>

      <label id="29e66"></label><address id="29e66"><mark id="29e66"><strike id="29e66"></strike></mark></address>
      學(xué)習(xí)啦 > 學(xué)習(xí)電腦 > 工具軟件 > 辦公軟件學(xué)習(xí) > word排版教程 > Word常見(jiàn)問(wèn)題 > 怎么在word中批量刪除頁(yè)眉和頁(yè)腳

      怎么在word中批量刪除頁(yè)眉和頁(yè)腳

      時(shí)間: 張偉670 分享

      怎么在word中批量刪除頁(yè)眉和頁(yè)腳

        在日常工作中,我們有時(shí)會(huì)碰到一大堆文件需要批量刪除頁(yè)眉與頁(yè)腳,如果一個(gè)個(gè)打開(kāi)文件手工刪除的話,會(huì)很耗時(shí)間精力,下面小編就教你怎么在word中批量刪除頁(yè)眉和頁(yè)腳,希望對(duì)你有幫助!

        word中批量刪除頁(yè)眉和頁(yè)腳的步驟

        首先,我先制作一個(gè)測(cè)試文件夾,里面包含幾個(gè)word文檔,都有頁(yè)眉--百度經(jīng)驗(yàn)這四個(gè)字,當(dāng)然其他的文字也行,只是一個(gè)測(cè)試;


      word中批量刪除頁(yè)眉和頁(yè)腳的步驟圖1

        下面我們需要打開(kāi)宏,03版的宏不需要去開(kāi)啟開(kāi)發(fā)工具,只需要點(diǎn)擊菜單欄中的工具-宏-宏;


      word中批量刪除頁(yè)眉和頁(yè)腳的步驟圖2

        進(jìn)入宏對(duì)話框,我們可以在宏名隨便輸入英文字母,在右側(cè)點(diǎn)擊一下創(chuàng)建;


      word中批量刪除頁(yè)眉和頁(yè)腳的步驟圖3

        接著,進(jìn)入了宏代碼編寫(xiě)框,將下面代碼復(fù)制進(jìn)來(lái):

        Sub 批量刪除頁(yè)眉頁(yè)腳()

        Application.ScreenUpdating = False

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

        With Application.FileDialog(msoFileDialogFolderPicker)

        .Title = "選擇要處理目標(biāo)文件夾" & "——(刪除里面所有Word文檔的頁(yè)眉頁(yè)腳)"

        If .Show = -1 Then

        MyPath = .SelectedItems(1)

        Else

        Exit Sub

        End If

        End With

        With Application.FileSearch

        .LookIn = MyPath

        .FileType = msoFileTypeWordDocuments

        If .Execute > 0 Then

        For i = 1 To .FoundFiles.Count

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

        ' B可以替換的宏

        ' 以下是處理格式所錄制的宏,可根據(jù)所需錄制

        If ActiveWindow.View.SplitSpecial <> wdPaneNone Then

        ActiveWindow.Panes(2).Close

        End If

        If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _

        ActivePane.View.Type = wdOutlineView Then

        ActiveWindow.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

        ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument

        Selection.Sections(1).Footers(1).PageNumbers.Add PageNumberAlignment:= _

        wdAlignPageNumberRight, FirstPage:=True

        ' 以上可以換成是你自己錄制的宏

        ' C公共部分的代碼

        Application.DisplayAlerts = False '強(qiáng)制執(zhí)行“是”

        'ActiveDocument.Saved = True'強(qiáng)制執(zhí)行“否”

        ActiveDocument.Close '退出

        Next

        End If

        End With

        Application.ScreenUpdating = True

        MsgBox "所選Word文檔的頁(yè)眉頁(yè)腳已刪除!!!", 64, "☆★處理完畢★☆"

        End Sub


      word中批量刪除頁(yè)眉和頁(yè)腳的步驟圖4

        現(xiàn)在,我們關(guān)閉窗口,重新回到word界面,按下宏快捷鍵,Alt+F8,看到剛才的宏名,點(diǎn)擊運(yùn)行;


      word中批量刪除頁(yè)眉和頁(yè)腳的步驟圖5

        接著軟件會(huì)讓我們選擇要批量處理的文件夾,選中之,然后稍等片刻,即會(huì)彈出--所選Word文檔的頁(yè)眉頁(yè)腳已刪除。


      word中批量刪除頁(yè)眉和頁(yè)腳的步驟圖6

        >>>下一頁(yè)更多精彩“刪除word中頁(yè)眉和頁(yè)腳方法”

      417028