G
Greg
Please open and new blank document and type three paragraphs:
Test
Test
Test
Now run this code:
Sub Test2()
Dim oRng As Word.Range
Dim i As Long
Set oRng = ActiveDocument.Paragraphs(1).Range
MsgBox oRng
With oRng.Find
.Text = "Greg"
While .Execute
i = i + 1
Wend
End With
MsgBox i
End Sub
While the range is clearly set to paragraph(1), the text is found three
times.
What is the explanation for this behavior.
Thanks
Test
Test
Test
Now run this code:
Sub Test2()
Dim oRng As Word.Range
Dim i As Long
Set oRng = ActiveDocument.Paragraphs(1).Range
MsgBox oRng
With oRng.Find
.Text = "Greg"
While .Execute
i = i + 1
Wend
End With
MsgBox i
End Sub
While the range is clearly set to paragraph(1), the text is found three
times.
What is the explanation for this behavior.
Thanks