Tony,
Concur with your explanation in the Customization group message. That
is why I said:
"For me a more common problem is the job won't complete without that
statement."
This is a good explanation of what happens with .Execute:
Each Find operation (each execution of the .Execute) is a stand-alone Find
and follows the same set of rules: if the range exactly satisfies the Find
criteria it is presumed to have been the result of a previous Find for the
same thing and searching starts after the range (the range is effectively
automatically collapsed); otherwise the Range is searched and if that
results in a not found condition, further searching depends on the Wrap
value.
This might give anyone following this string a good example of how the
collapse statement ensures the code procedes when the range is reduced
and ensures it doesn't get in a continous loop if the range is expanded
in the .Execute portion of the code:
Sub Test1()
Dim oRng As Word.Range
Set oRng = ActiveDocument.Range
With oRng.Find
.Text = "<*>"
.MatchWildcards = True
While .Execute
MsgBox oRng.Text
oRng.MoveEnd wdCharacter, -1
oRng.MoveStart wdCharacter, 1
MsgBox oRng.Text
oRng.Collapse wdCollapseEnd
Wend
End With
Set oRng = ActiveDocument.Range
With oRng.Find
.Text = "<*>"
.MatchWildcards = True
While .Execute
MsgBox oRng.Text
oRng.MoveEnd wdCharacter, 1
oRng.MoveStart wdCharacter, -1
oRng.Collapse wdCollapseEnd
MsgBox oRng.Text
Wend
End With
End Sub