|
|
I would like to see an vba example for a simple search and replace in a word document. The search string ( "##co_name" ) may exist in more than one page in the document body, but it won't be found in the header or the footer.
TIA
-- CBenac
|
|
Hi CBenac,
try that:
Sub Test444a() Dim rDcm As Range Set rDcm = ActiveDocument.Range With rDcm.Find .Text = "##co_name" .Replacement.Text = "MyFirm" .Execute Replace:=wdReplaceAll End With End Sub --
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Vista Small Business, Office XP
|
|
|