View Single Post
 
Old 02-21-2023, 12:18 PM
alex100 alex100 is offline Windows 7 64bit Office 2016
Advanced Beginner
 
Join Date: May 2020
Posts: 79
alex100 is on a distinguished road
Default Get the position of a string from the cursor position forward

In a Word document, how can I get the position of a string from the cursor position forward?

For example, if the cursor is on the 10th line from the start of the document and the string I am trying to find is on the 15th line, the function should return 5.

If the string is found in multiple places throughout the document (both before and after the cursor), the function should return the position of the first match after the cursor. If it is found only before the cursor (or not found at all), the function should return a null value.

Thank you!

Alex
Reply With Quote