marcellnoel26
New Member
- Joined
- Mar 20, 2020
- Messages
- 1
- Office Version
- 365
- 2016
- Platform
- Windows
Good Afternoon,
I'm trying to modify my current code to replace specified words in a MS Word document. The whole idea is working but only for the body of the document and nothing happens in the header neither in the footer. Can you please advise me where am I wrong ?
Thank you in advance!
I'm trying to modify my current code to replace specified words in a MS Word document. The whole idea is working but only for the body of the document and nothing happens in the header neither in the footer. Can you please advise me where am I wrong ?
Thank you in advance!
VBA Code:
Sub FindAndReplace(ByVal FindWord, ByVal ReplaceWord)
WordApp.ActiveDocument.Range.Find.Execute FindText:=FindWord, Wrap:=1, ReplaceWith:=ReplaceWord, Replace:=2
End Sub