A family of Microsoft word processing software products for creating web, email, and print documents.
Try this:
Sub SearchAllHeadersAndFooters()
Dim rng As Word.Range, s As Word.Section, hf As Word.HeaderFooter
For Each s In ActiveDocument.Sections
'headers and footers are part of each section in a document
'all sections must be searched
For Each hf In s.Headers
'there are 3 headers that will be searched (primary, even, & first page)
Set rng = hf.Range
If InStr(1, rng.Text, "your string") = True Then
'perform your custom action
End If
Next hf
For Each hf In s.Footers
'there are 3 footers that will be searched (primary, even, & first page)
Set rng = hf.Range
If InStr(1, rng.Text, "your string") = True Then
'perform your custom action
End If
Next hf
Next s
End Sub
Hope this helps