View Single Post
 
Old 11-06-2022, 10:38 AM
gmaxey gmaxey is offline Windows 10 Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,601
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

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
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote