我想替换页脚中的标签。它可以工作,但替换会删除页脚文本上方的水平线。如何在不删除水平线的情况下替换标签?如何在页脚中画一条线?
Private Sub Document_Open()
Dim unit As String
Dim footer As String
unit = "New text"
footer = ActiveDocument.Sections(1).Footers(wdHeaderFooterFirstPage).Range.Text
ActiveDocument.Sections(1).Footers(wdHeaderFooterFirstPage).Range.InlineShapes.AddHorizontalLineStandard
footer = Replace(footer, "<<Label>>", unit)
ActiveDocument.Sections(1).Footers(wdHeaderFooterFirstPage).Range.Text = footer
End Sub