Sub CleanDocumentFormatting() Dim doc As Document Dim sec As Section Dim rng As Range Dim shp As Shape Dim pic As InlineShape Set doc = ActiveDocument ' 删除所有页眉页脚 For Each sec In doc.Sections sec.Footers(wdHeaderFooterPrimary).Range.Delete sec.Footers(wdHeaderFooterFirstPage).Range.Delete sec.Footers(wdHeaderFooterEvenPages).Range.Delete Next sec ' 转换分节符为分页符 Set rng = doc.Content With rng.Find .ClearFormatting .Text = "^b" ' 查找分节符 .Replacement.Text = "^m" ' 替换为分页符 .Execute Replace:=wdReplaceAll End With ' 删除所有图形对象 For Each shp In doc.Shapes shp.Delete Next shp For Each pic In doc.InlineShapes pic.Delete Next pic MsgBox "文档清理完成:" & vbCrLf & _ "1. 已删除所有页眉页脚" & vbCrLf & _ "2. 已转换分节符为分页符" & vbCrLf & _ "3. 已清除全部图形对象", vbInformation End Sub