Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-19-2023, 06:45 AM
Writer243 Writer243 is offline Macro for automatic reference detection and mark up Windows 10 Macro for automatic reference detection and mark up Office 2021
Novice
Macro for automatic reference detection and mark up
 
Join Date: Jun 2023
Posts: 1
Writer243 is on a distinguished road
Question Macro for automatic reference detection and mark up

Hi VBA forum,



I am writing a book within a legal field and have a lot of cases referenced in my text. I know I could go through all 600+ pages and mark each case for the index manually but I would prefer to automate the process.

Is there any way to make Word identify the most common case formats? (the most common are on the basis of U YYYY.XXX ending with either Ø, V or H, for example U 1994.237 H)

And in addition, is there any way to make Word mark such entries as an index word automatically?
Reply With Quote
  #2  
Old 06-19-2023, 07:25 AM
gmaxey gmaxey is offline Macro for automatic reference detection and mark up Windows 10 Macro for automatic reference detection and mark up Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
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
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro for automatic reference detection and mark up How to use Word Macro to change all highlighted words as mark-up? hcl75 Word VBA 3 10-08-2022 02:39 PM
Macro for automatic reference detection and mark up Macro to Mark Text with Index Codes MyUserName123 Word VBA 10 07-07-2020 07:59 PM
Automatic supplier contact detection at Outlook and Lync LordLA Outlook 0 07-30-2015 02:40 AM
Macro to mark non-coloured/non-highlighted text as hidden PeterB Word 0 10-28-2009 07:54 AM
automatic requirement numbering with change detection stijnos Word 0 05-13-2009 12:10 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:15 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft