I am running a macro to reset the 'Courier New' for any words found in the document. This works fine if the 'Courier New' word is *not* in the table.
If the 'Courier New' word is in the table, it goes in a loop.
The code is as follows:
Code: Select all
Function ResetCourierNewWords()
' ------------------------------------------------------------------------------
' Do not courierise blank paragraphs, etc.
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = ""
.Font.Name = "Courier New"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
While (Selection.Find.Execute)
Selection.Font.Reset
Selection.Collapse Direction:=wdCollapseEnd
Wend
End Function
Thanks.