search for word in word doc

S

sarah

I want to write code so that if a word in a variable in the vba behind word
is equal to a word in the word document, it changes that word in the document
to bold.
How would i do that?
 
A

Alex Ivanov

With ActiveDocument.Range.Find
.Text = "My Text"
.Replacement.Font.Bold = True
.Execute Replace:=wdReplaceAll
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top