I have an excel document with two columns and 100 rows. One column is a word to look for in a word document and the second column is the word that I want to replace the searched word with.
I want to iterate through each row in the excel table and use the inputs to search and replace in a word document.
I have experience with VBA in Access but I have never used it with Word or Excel before and I am very confused.
The function I think will work is this:
function replace(find,replace)
with activedocument.content.find
.forward=True
.wrap=wdFindContinue
.Execute fintext:=find,replacewith:=replace,matchcase:=False,matchwholeword:=True
end with
end function
In access you would then call that function in an event, but word doesn't have events. I just want to run the code. When I select run a form asking me to create a macro appears and I get lost.
How do I run vba code in Word?
Thanks