No, it doesn't 'have' to be so complicated, but leaving out some parameters might lead to unexpected results ...
Re:
Quote:
change it's style to Body Text and make it bold face
|
That's not what the code I posted does. Based on what you had posted, the code I posted looks for 'Synopsis' that is already in the 'Body Text' Style. Furthermore, you can't re-format only a single word of many in a paragraph with the 'Body Text' Style, as that Style is a paragraph Style. Of course, that doesn't matter if 'Synopsis' is the only word in the paragraphs concerned.
As for changing the font to bold, if 'Synopsis' is the only word in the paragraphs concerned, you'd do better to change the 'Body Text' Style's font to bold than to override the Style format. Similarly, if 'Synopsis' is only one word of many in a paragraph, you'd do better to apply the 'Strong' character Style to 'Synopsis' than to override the Style format. For example:
Code:
Sub Demo()
Application.ScreenUpdating = False
With Selection
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "Synopsis"
.Replacement.Text = "^&"
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = True
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Replacement.Style = "Body Text"
.Execute Replace:=wdReplaceAll
.Replacement.Style = "Strong"
.Execute Replace:=wdReplaceAll
End With
End With
Application.ScreenUpdating = True
End Sub