View Single Post
 
Old 12-10-2012, 03:55 PM
Jack Jack is offline Mac OS X Office for Mac 2011
Novice
 
Join Date: Dec 2012
Posts: 2
Jack is on a distinguished road
Default Find and Replace Format macro issue

Disclaimer: I'm new to VBA and macros... Please bear with me. I've tried to research answers to my problem elsewhere, but no luck.

My purpose is to strip my Word document of all formatting, paste it into a text-only text editor, then copy that text and re-paste back into a new Word document. The goal is to have as "clean" a Word document as possible for upload to a third-party website. (Site is Smashwords. I'm trying to expedite their directions for what they term their "nuclear option.")

The particular macros I'm working on are for italics. If I can get these macros to work, I'll modify for bold and underline formats also.

For macro 1:

In Advanced Find and Replace, I do
Find what: [blank]
Format: Italic

and then
Replace with: III^&III

That's macro 1. Basically it's inserting the placeholder tags "III" immediately before and after all italicized text.

For macro 2, I want to re-italicize the text and delete the placeholder "III" tags.

However, for macro 1, I can't get the macro to work. I used the macro recorder. When I do it manually it works fine. But then when I try to run the macro I recorded when I did it manually, nothing happens. Maybe the recorder can't follow when I click on some of the Advanced Find and Replace Format menus?

I haven't even tried doing macro 2 yet, since I can't get macro 1 to work.

Any assistance appreciated. Thanks.
Reply With Quote