mix
mix

Reputation: 7151

How to wrap italic text in Word within <em> tags?

I need to replace all italicized text in a Word document with that same text wrapped in <em> tags, such as:

Original: The fox jumped over the dog. Replaced: The <em>fox</em> jumped <em>over the dog</em>.

I can see how to search for the italicized text, but how can I specify the original found text in the Replace: dialog? Word supports regex, so I was trying something along these lines:

Find: (*) (w/ italic Font turned on) Replace: <em>\1</em>

But instead of wrapping any italic string in em tags, it wraps every single character that is italic in an tag.

Thanks for any help. Note: yes, I could probably do this in another editor more easily; however, for a variety of reasons I need to leave it in Word.

Upvotes: 1

Views: 1502

Answers (1)

syeeric
syeeric

Reputation: 31

A bit late, but here is the thing:

  • Go to Find -> Advanced Find and Replace -> Replace in Word
  • At the very bottom you can choose formatting so choose Font - Italic.
  • In Replace With choose Special - Find What Text - it will add ^&.
  • Add whatever you want to - example : <em>^$</em>

Upvotes: 3

Related Questions