R
Rick English
How can I get the following subroutine to search and replace in the headers
and footers as well. The document has three sections with different headers
Thanks
Sub find_replace_text(oldtext As String, newtext As String)
Dim newtext1 As String
newtext1 = Replace(newtext, Chr$(10), "")
newtext1 = Replace(newtext1, Chr$(13), "^p")
' find_replace Macro
Set myrange = ActiveDocument.Content
'newtext1 = Check_Text(newtext)
With myrange.Find
.ClearFormatting
.Text = oldtext
With .Replacement
.Text = newtext1
End With
.Execute Replace:=wdReplaceAll
End With
End Sub
and footers as well. The document has three sections with different headers
Thanks
Sub find_replace_text(oldtext As String, newtext As String)
Dim newtext1 As String
newtext1 = Replace(newtext, Chr$(10), "")
newtext1 = Replace(newtext1, Chr$(13), "^p")
' find_replace Macro
Set myrange = ActiveDocument.Content
'newtext1 = Check_Text(newtext)
With myrange.Find
.ClearFormatting
.Text = oldtext
With .Replacement
.Text = newtext1
End With
.Execute Replace:=wdReplaceAll
End With
End Sub