View Single Post
 
Old 06-19-2023, 07:25 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

Yes, it is possible. What have you tried? This is not a complementary code writing service. We are here to help you write your code. Some people write books for a living, others write code .


You would start with a macro that "finds" the desired strings. For example your find text would be:



.Text = "U [0-9]{4}.[0-9]{3} [HV" & ChrW(216) & "]"


When that text is found, you would insert an index entry:


ActiveDocument.Indexes.MarkEntry "Found Range", "Found Text"


Collapse and move the range passed the entry and loop to find next instance of text.


There are plenty of examples of using VBA to find text.
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote