CaptainJack
07-28-2008, 02:03 PM
I'm writing a Word macro (and I don't write Word macros often) that will insert some text at a certain point in my document based on the first letter of the next word after the cursor in the document.
For example: In my document I have this text:
"See also Compliance"
and I wand to insert "A-C:" in front of the word Compliance
So, after the insert the sentence would read "See also A-C:Compliance"
"So, just type it" you say... well, there are approximately 6000 of these little goodies in my doc so I need a macro.:banghead:
I can record most of the steps, however I'm at a loss as to how to write the code that will select the word "Compliance", stuff it into a variable and use it in a case statement that says basically:
If the first letter of the selected word is greater than or equal to A and less than or equal to C, insert "A-C:" before the selected word.
Any help would be greatly appreciated.:help
For example: In my document I have this text:
"See also Compliance"
and I wand to insert "A-C:" in front of the word Compliance
So, after the insert the sentence would read "See also A-C:Compliance"
"So, just type it" you say... well, there are approximately 6000 of these little goodies in my doc so I need a macro.:banghead:
I can record most of the steps, however I'm at a loss as to how to write the code that will select the word "Compliance", stuff it into a variable and use it in a case statement that says basically:
If the first letter of the selected word is greater than or equal to A and less than or equal to C, insert "A-C:" before the selected word.
Any help would be greatly appreciated.:help