Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

put bracketed text in italics 1

Status
Not open for further replies.

dasmotiu

Programmer
Nov 30, 2010
8
0
0
US
I have some text (actually a lot of text, about 300 pages) which has been "dumbed down" to flat ASCII and anything that was in italics has been surrounded by [brackets].

I have imported this text into Word, and since I am not a VBA expert, I'd like to write a simple VBA macro to remove the brackets and put the text back into italics. I have not mastered the concept of extending the selection to an arbitrary point. btw ... I understand the potential mess if there happen to be cases where the brackets are unbalanced, and do not need it to handle this case.

Suggestions would be appreciated.
 
Hi dasmotui,

You don't need a macro! You can do this with a wildcard Find/Replace, where:
Find = \[([!\]]{1,})\]
Replace = \1
and you format the 'Replace' font as italic. When you open the Find/Replace dialogue box, click on the 'More' button to access the wildcard and formatting options.

Cheers
Paul Edstein
[MS MVP - Word]
 
Thank you, I changed about 500 instances of that in about 2 seconds. I am extremely glad to have joined this board.
 
Hi dasmotiu,

You're welcome!

Cheers
Paul Edstein
[MS MVP - Word]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top