当word页眉用下一页分隔符并且取消了“链接到前一条页眉”的时候,如何全文替换页眉?
什么时代了,帮助以外的东西学会使用Ai搜索啊,都有现成的代码

此主题相关图片如下:1.png

Try
Dim doc = app.Documents.Open(fl)
For Each section As Object In doc.Sections
Dim headerRange = section.Headers(MSWord.WdHeaderFooterIndex.wdHeaderFooterPrimary).Range
headerRange.Text = headerRange.Text.Replace("替换页眉", "111").trim(vbcr).trim(vblf)
Next
Doc.save
Doc.close
Catch ex As exception