View Single Post
 
Old 03-21-2024, 04:59 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

It is not working because there are no cross reference fields in the defined range.
Your code would only find and select the first wdFieldRef in the selected text.


If you are on page 999 of a 1000 page document containing 25,000 cross references, does it make sense to loop through 24,900 or so to find the next one? If you want to find the next wdFieldRef from your current location then you need to define the range to be from where you are at to where you want the search to end. E.g., end of section, end of document whatever.
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote