Quote:
Originally Posted by gmaxey
Finding text with a range object doesn't select the text so your selection is where it is throughout the process:
Code:
Dim oRng As Range
Sub getPosition()
Debug.Print oRng.Information(wdVerticalPositionRelativeToPage)
Debug.Print oRng.Information(wdHorizontalPositionRelativeToPage)
End Sub
Sub Test()
Set oRng = ActiveDocument.Range
With oRng.Find
.Text = "Test Words"
While .Execute
getPosition
oRng.Collapse wdCollapseEnd
Wend
End With
End Sub
|
Thanks for the update. With the information about select that you provided, I managed to get my code working by adding rngSearch.Select within the Do While Loop. That got me what I needed. Thank you.