方法/步骤假如我手上有500个word文档需要删除页眉页脚先把需要删除页眉页脚的500个word文档放在一个文件夹下,然后打开其中一个文档在打开的文档中,选择在“工具”菜单中选择“宏”--“宏”随后弹出“宏”对话框,在宏名中输入"Application",最后点击"创建"按钮随后弹出“Microsoft visual basic”设计,在编辑处输入如下代码Sub 批量删除Word页眉页脚() = False Dim MyPath As String, i As Integer, myDoc As Document With (msoFileDialogFolderPicker) .Title = "选择要处理目标文件夹" & "——(删除里面所有Word文档的页眉页脚)" If .Show = -1 Then MyPath = .SelectedItems(1) Else Exit Sub End If End With With .LookIn = MyPath .FileType = msoFileTypeWordDocuments If .Execute > 0 Then For i = 1 To . Set myDoc = (FileName:=.FoundFiles(i)) ' B可以替换的宏' 以下是处理格式所录制的宏,可根据所需录制If <> wdPaneNone Then (2).Close End If If = wdNormalView Or ActiveWindow. _ = wdOutlineView Then = wdPrintView End If = wdSeekCurrentPageHeader Unit:=wdCharacter, Count:=1 With .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 = True Then = wdSeekCurrentPageFooter Else = wdSeekCurrentPageHeader End If Unit:=wdCharacter, Count:=1 = wdSeekMainDocument (1).Footers(1). PageNumberAlignment:= _ wdAlignPageNumberRight, FirstPage:=True' 以上可以换成是你自己录制的宏' C公共部分的代码 = False '强制执行“是”' = True'强制执行“否” '退出 Next End If End With = True MsgBox "所选Word文档的页眉页脚已删除!!!", 64, "☆★批量处理完毕★☆"End SubSub ConvertEqns()'' ConvertEqns Macro' 宏在 2014-6-25 由 USER 创建'End Sub输入代码后,关闭窗口返回文档,重新选择在“工具”菜单中选择“宏”--“宏”,在弹出的宏名中选择"批量删除Word页眉页脚",最后点击“运行”---确认即可快速地删除500个Word页眉页脚