Applying Styles

C

Chuck Henrich

This should do it:


Sub ApplyStyleToPhrase()

Dim rng As Range

Set rng = ActiveDocument.Range

With rng.Find
.ClearFormatting
.Replacement.ClearFormatting
.Wrap = wdFindStop
.Text = "my phrase"
While .Execute
rng.Style = "Emphasis"
'apply a character style to just change
'to change the formatting for just the phrase
'or a paragraph style to change the formatting
'for the paragraph the phrase appears in
Wend
End With

End Sub

HTH
 

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