Select the Header as the range to search in Microsoft Word

780 Views Asked by At

I have some text in the header of a Word document.

I have a find and replace method that searches for text and then replaces it if it is found.

How do I only select the header to be the range to search and replace for key words?

1

There are 1 best solutions below

0
On BEST ANSWER

Access the header and find inside it?

this.Doc.Sections[1].Headers[Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Find()

or select the header and search the selection:

this.Doc.Sections[1].Headers[Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Select
Application.Select.Find()