Code:
Sub FindUntiltheEndofDocument()
Dim oRange As Range
Set oRange = ThisDocument.Range(0, 0)
With oRange.Find
.ClearFormatting
.MatchCase = False
.Text = "cat"
While .Execute
oRange.Select
'' Why is it needed?
oRange.Collapse Direction:=wdCollapseEnd
Wend
Set oRange = Nothing
End With
End Sub
Even without the line,
Code:
oRange.Collapse Direction:=wdCollapseEnd
it is still the same in effect as with this line of codes.
Why is the range needed to be collapsed to the end then?