我一直在尝试使用录制的宏替换大量word文档上的标题图像并替换页脚图像。但是,当我在新文档上运行宏时,它不会替换图像并从文本框中删除文本。它根本不会触及页脚图像。我过去使用过基本的录制宏,但没有替换页脚中的图像或图像。一位朋友提到插入图像可能需要 VBA,但我不是该语言的新手。
Sub BrandingUpdateV2()
'
' BrandingUpdateV2 Macro
'
'
ActiveDocument.Shapes.Range(Array("Text Box 2")).Select
Selection.TypeBackspace
Selection.MoveDown Unit:=wdLine, Count:=4
Selection.MoveDown Unit:=wdLine, Count:=13
Selection.MoveUp Unit:=wdLine, Count:=3
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 = wdSeekCurrentPageFooter
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
Selection.MoveDown Unit:=wdLine, Count:=42
Selection.MoveUp Unit:=wdLine, Count:=10
Selection.MoveDown Unit:=wdLine, Count:=1
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 = wdSeekCurrentPageFooter
Selection.HeaderFooter.Shapes.Range(Array("Group 50")).Select
Selection.HeaderFooter.Shapes.Range(Array("Slide Number Placeholder 11" _
)).Select
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End Sub