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
 
Top