Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 Word 文档的标题中有一些文本。
我有一个查找和替换方法,可以搜索文本,然后在找到时替换它。
如何仅选择标题作为关键字搜索和替换的范围?
访问标题并在其中找到?
this.Doc.Sections[1].Headers[Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Find()
或选择标题并搜索选择:
this.Doc.Sections[1].Headers[Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Select Application.Select.Find()