Code:
Sub ReplaceTextInHeader()
Dim oHF As HeaderFooter
Dim oSection As Section
Dim myfle
PathToUse As String
PathToUse = "C:\Test\"
myfile = Dir(PathToUse & "*.doc")
Do While myfle <> ""
Documents.Open (PathToUse & myfile)
For Each oSection In ActiveDocument.Sections
For Each oHF In oSection.Headers
oHF.Range.Text = Replace(oHF.Range.Text, "Revision", "Final")
Next
Next
ActiveDocument.Close SaveChanges:=wdSaveChanges
myfile = Dir()
Loop
End Sub
If the replace is just text, and just in the header - "that will go through and replace text in a header" - then why bother going through the storyranges. Just deal with the headers.
The code above replace the word "Revision" with "Final" in ALL headers, in ALL documents in the folder.