Howdo office experts.
Looking for a way to go thru a word document and find words inside tags and replace that word with something else.
So basically a word doc which has say lots of these, all with variable text
Hello there <fred1>
<fred2>
some text here
some text there
<fred3>
wow this is a <fred4> letter
<fred1>
the last line
So Im after a vba macro which goes from top to bottom of doc that looks for words within < > and replace with summat else.
Problem with chevrons is they are reserved for wildcard searches.
I found u can do [<>] but then that find the first < then next >. I dont want the hassle of figuring out the words in between - unless someone can do it for me that is :)
Each match I find, I will replace it with text. For the purpose of this question, just replace with "BBC"
Once it gets to the bottom of the document, it stops.
I think replacement part is easy, can use Find.Execute and specify with ReplaceAll,
well so I think. Difficult part is trying to get the text between chevrons
Cheers!
Start Free Trial