wrdapp.Selection.Find.ClearFormatting
wrdapp.Selection.Find.Replacement.ClearFormatting
With wrdapp.Selection.Find
.Text = "XXXXXXXX"
.Replacement.Text = "YYYYYYYYY"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
wrdapp.Selection.Find.Execute Replace:=2