怎么在word中批量刪除頁眉和頁腳_第1頁
怎么在word中批量刪除頁眉和頁腳_第2頁
怎么在word中批量刪除頁眉和頁腳_第3頁
怎么在word中批量刪除頁眉和頁腳_第4頁
怎么在word中批量刪除頁眉和頁腳_第5頁
全文預覽已結束

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領

文檔簡介

1、怎么在word中批量刪除頁眉和頁腳在日常工作中,我們有時會碰到一大堆文件需要批量刪除頁眉與頁腳,如果一個個打開文件手工刪除的話,會很耗時間精力,下面小編就教你怎么在word中批量刪除頁眉和頁腳.word中批量刪除頁眉和頁腳的步驟:首先,我先制作一個測試文件夾,里面包含幾個word文檔,都有頁眉-百度經(jīng)驗這四個字,當然其他的文字也行,只是一個測試;下面我們需要打開宏,03版的宏不需要去開啟開發(fā)工具,只需要點擊菜單欄中的工具-宏-宏;進入宏對話框,我們可以在宏名隨便輸入英文字母,在右側(cè)點擊一下創(chuàng)建;接著,進入了宏代碼編寫框,將下面代碼復制進來:Sub 批量刪除頁眉頁腳()Application.S

2、creenUpdating = FalseDim MyPath As String, i As Integer, myDoc As DocumentWith Application.FileDialog(msoFileDialogFolderPicker).Title = "選擇要處理目標文件夾" & "(刪除里面所有Word文檔的頁眉頁腳)"If .Show = -1 ThenMyPath = .SelectedItems(1)ElseExit SubEnd IfEnd WithWith Application.FileSearch.LookI

3、n = MyPath.FileType = msoFileTypeWordDocumentsIf .Execute > 0 ThenFor i = 1 To .FoundFiles.CountSet myDoc = Documents.Open(FileName:=.FoundFiles(i)' B可以替換的宏' 以下是處理格式所錄制的宏,可根據(jù)所需錄制If ActiveWindow.View.SplitSpecial <> wdPaneNone ThenActiveWindow.Panes(2).CloseEnd IfIf ActiveWindow.Acti

4、vePane.View.Type = wdNormalView Or ActiveWindow. _ActivePane.View.Type = wdOutlineView ThenActiveWindow.ActivePane.View.Type = wdPrintViewEnd IfActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeaderSelection.WholeStorySelection.Delete Unit:=wdCharacter, Count:=1Selection.WholeStoryWith Sele

5、ction.ParagraphFormat.Borders(wdBorderLeft).LineStyle = wdLineStyleNone.Borders(wdBorderRight).LineStyle = wdLineStyleNone.Borders(wdBorderTop).LineStyle = wdLineStyleNone.Borders(wdBorderBottom).LineStyle = wdLineStyleNoneWith .Borders.DistanceFromTop = 1.DistanceFromLeft = 4.DistanceFromBottom = 1

6、.DistanceFromRight = 4.Shadow = FalseEnd WithEnd WithWith Options.DefaultBorderLineStyle = wdLineStyleSingle.DefaultBorderLineWidth = wdLineWidth075pt.DefaultBorderColor = wdColorAutomaticEnd WithIf Selection.HeaderFooter.IsHeader = True ThenActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageF

7、ooterElseActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeaderEnd IfSelection.WholeStorySelection.Delete Unit:=wdCharacter, Count:=1ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocumentSelection.Sections(1).Footers(1).PageNumbers.Add PageNumberAlignment:= _wdAlignPageNumberRight, FirstPage:=True' 以上可以換成是你自己錄制的宏' C公共部分的代碼Application.DisplayAlerts = False '強制執(zhí)行“是”'ActiveDocument.Saved = True'強制執(zhí)行“否”ActiveDocument.Close '退出NextEnd IfEnd WithApplication.ScreenUpdating = TrueMsgBox "所選Word文檔的頁眉頁腳已刪除!", 64, "

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論