如何用vba修改word页眉中的文本框内容

2024-10-22 13:30:39
有1个网友回答
网友(1):

其实通过宏录制你就完全可以明白,有些问题是可以自己轻易解决的,宏录制是学习vba很重要的一个步骤,自己要多尝试 :
如下
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
ActiveDocument.AttachedTemplate.BuildingBlockEntries(" 空白").Insert Where:= _
Selection.Range, RichText:=True
Selection.TypeText Text:="暗暗暗暗"