乔山办公网我们一直在努力
您的位置:乔山办公网 > office365 > 同一个word文档页眉页脚如何批量修改,一个一个修改太麻烦,...-office如何修改两个页眉页脚,word怎样去掉页

同一个word文档页眉页脚如何批量修改,一个一个修改太麻烦,...-office如何修改两个页眉页脚,word怎样去掉页

作者:乔山办公网日期:

返回目录:office365


页眉,页脚,一样删除



方法1、如果你的页眉页脚是统一的一致的,那么你可以将文档中的分节符替换为分页符,替换方法是:ctrl+h调出替换对话框
查找内容输入:^m
替换为输入:^m
高级或更多选择“使用通配符”,点击全部替换
方法2、如果你的页眉页脚是不完全一致的,而你需要修改的内容是一直的,那么直接用替换命令进行替换,但要注意的是,需要逐个查找后替换,避免将正文中的内容也替换掉了。
打开带有页眉页脚的word文档,双击页眉,

在页眉处右键单击,单击“边框和底纹”,

将边框设置为”无“,单击面板下面的“应用于”长方形条框,将改为”图片“改为”段落“,单击”确定“,如图:

回到文档,发现页眉上的横条已经不复存在,双击页眉,按”Ctrl+A“全选页眉,单击键盘上的Delete,页眉消失,如图

用同样的方法设置页脚。

方法/步骤

假如我手上有500个word文档需要删除e799bee5baa6e79fa5e98193e59b9ee7ad94339页眉页脚

先把需要删除页眉页脚的500个word文档放在一个文件夹下,然后打开其中一个文档

在打开的文档中,选择在“工具”菜单中选择“宏”--“宏”

随后弹出“宏”对话框,在宏名中输入"Application",最后点击"创建"按钮

随后弹出“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 .Execute > 0 Then
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.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 '强制执行“是”
'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

输入代码后,关闭窗口返回文档,重新选择在“工具”菜单中选择“宏”--“宏”,在弹出的宏名中选择"批量删除Word页眉页脚",最后点击“运行”---确认即可快速地删除500个Word页眉页脚

相关阅读

关键词不能为空
极力推荐

ppt怎么做_excel表格制作_office365_word文档_365办公网