K
Keith G Hicks
Word 2003.
I'm trying to create a macro to search with word's regex but word's regex
seems pretty limited and I'm having trouble. HEre's what I need to do:
I need to find insteances like the following:
Section I Green
Section I Blue
Section II Green
Section II Blue
Section III Green
Section III Blue
Section IV Green
Section IV Blue
etc.
Then I want to replace each of the above with the same text but Bold,
Underlined and with a carriage return after each one so that there's a blank
line below. There could be any number of sections. I have no way to predict
how many there could be. Of course I could write code to handle up to a
certain number (say 20 for example) and just hard code them in but that
seems silly.
One other thing. I used the "record macro" feature to do a search and then
bold/underline/return (but without the wildcard/regex idea). While I was
recording the macro, the text did turn bold/underline and had the return.
But then when I actually ran the code that was recorded, only the return
worked. The text was not bolded or underlined. Why is this?
I know I could do this in vb.net using RegEx but I'm trying to avoid writing
a vb.net app to do this.
Hoping someone can help,
Keith
I'm trying to create a macro to search with word's regex but word's regex
seems pretty limited and I'm having trouble. HEre's what I need to do:
I need to find insteances like the following:
Section I Green
Section I Blue
Section II Green
Section II Blue
Section III Green
Section III Blue
Section IV Green
Section IV Blue
etc.
Then I want to replace each of the above with the same text but Bold,
Underlined and with a carriage return after each one so that there's a blank
line below. There could be any number of sections. I have no way to predict
how many there could be. Of course I could write code to handle up to a
certain number (say 20 for example) and just hard code them in but that
seems silly.
One other thing. I used the "record macro" feature to do a search and then
bold/underline/return (but without the wildcard/regex idea). While I was
recording the macro, the text did turn bold/underline and had the return.
But then when I actually ran the code that was recorded, only the return
worked. The text was not bolded or underlined. Why is this?
I know I could do this in vb.net using RegEx but I'm trying to avoid writing
a vb.net app to do this.
Hoping someone can help,
Keith