Results 1 to 2 of 2
2009-04-20, 22:35 #1
- Join Date
- Apr 2009
- Thanked 0 Times in 0 Posts
I need a VBA script or some ideas on how I can add a unique ID (UID) into a MS Word 2003 document.
The unique ID would consist of a 4 char string prefix followed by an integer number. The 4 char prefix is set once for the document. The integer part would start at one and be incremented upwards each time a UID is added.
Example UID: RTED1, RTED56, RTED781 etc.
The general scenario of use is as follows.
The user places the cursor at a location within a paragraph where the UID needs to be inserted.
The user would then select either a toolbar icon or a short-cut key which would check to see what was the last integer number used, increment this and then insert the UID into the cursor position.
The only specific font settings would be that the colour of the UID is red and bold, everything else such as font name, font size can be inherited from the paragraph style.
The prefix and last integer number used needs to be retained with the document so that subsequent UID's can continue to be added in later editing sessions. Using existing document property fields to store the prefix and last integer number used would be OK eg: Keywords, Comments; but if there are any hidden meta data fields that could be used that would be ideal.
Thanks in advance.
2009-04-21, 00:23 #2
- Join Date
- Feb 2001
- Silicon Valley, USA
- Thanked 93 Times in 89 Posts
[quote name='badga' post='771491' date='20-Apr-2009 20:35']I need a VBA script or some ideas on how I can add a unique ID (UID) into a MS Word 2003 document.[/quote]
This is a duplicate of [topic="762662"]Inserting Unique ID's into MSWord Paragraphs (VB/VBA Board)[/topic]. Please DO NOT duplicate questions on different boards because the discussion becomes fragmented. Please review Lounge Rules and Guidelines, especially #14. Locking this thread.