下載本文檔
版權說明:本文檔由用戶提供并上傳,收益歸屬內(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. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 憂郁療愈教案
- 擦黑板 教案 小學勞動二年級上冊魯科版
- 2022年企業(yè)安保上半年工作總結(5篇)
- 商務星球版八上地理 4.4繁榮地方特色文化 教案
- 初中數(shù)學人教版八上13.2畫軸對稱圖形 教案
- 汽車can總線課程設計
- 心理引導與學習方法教學設計
- 山西省平遙縣高中數(shù)學 第二章 基本初等函數(shù)(Ⅰ)2.2.1 對數(shù)與對數(shù)運算(2)教案 新人教A版必修1
- 防火防爆專業(yè)課程設計
- 博物館課程設計語
- 2024年全國煙花爆竹經(jīng)營單位安全生產(chǎn)考試題庫(含答案)
- 2024年統(tǒng)編版新教材語文小學一年級上冊第一單元測試題及答案
- 煤礦應急叫應、回應、響應機制
- 2024年內(nèi)蒙古財政廳事業(yè)單位筆試真題
- 選礦廠承包協(xié)議范本
- 兒科精準醫(yī)療的應用與進展
- 年產(chǎn)700噸青霉素的生產(chǎn)工藝設計
- 免責理療協(xié)議書范本
- 高中語文學習任務群的項目化設計-以統(tǒng)編教材必修上第一單元為例
- 企業(yè)存貨管理國內(nèi)外研究現(xiàn)狀
- 班主任專業(yè)能力大賽情景答辯小學組真題及答案
評論
0/150
提交評論