MS Word: Strip all styles while retaining formatting?
February 22, 2008 8:14 AM   Subscribe

I have a macro that takes an un-styled document, and tries to put text into the right styles based on what its formatting is. But, if the document already has some scheme of styles, the macro doesn't work very well. So, I would like to transform a Word document into an un-styled version of itself-- but one that retains ALL of the original formatting (italics, small caps, font size, spacing). What would be the most correct way to do this? I have Word 2003 (which the macro needs) and 2007, as well as Word 2008 for Mac. Also-- HTML doesn't work, as it doesn't retain small caps.
posted by yesno to Computers & Internet (10 answers total) 2 users marked this as a favorite
Would rich text (.rtf) work?.
posted by zingzangzung at 8:23 AM on February 22, 2008

Response by poster: No, RTF retains styles.
posted by yesno at 8:25 AM on February 22, 2008

Rather than un-stylizing the document, could you program your macro to work this way: using a search and replace, conduct a search for a specific formatting type and then assign this type a specific style (i.e. search for text that is Font: Times, Size: 16, Italics: On, and assign it Style: Heading 1)
posted by bitteroldman at 8:29 AM on February 22, 2008

Response by poster: The macro is not something that I have programmed. It is provided to me from a publishing company, and it is my job to run it and force documents into a specific template.
posted by yesno at 8:37 AM on February 22, 2008

At my job we have a set of macros made by Microsystems, and one of them removes applied styles and retains formatting. I have no clue if you can buy just that macro from them, or if your employer would do it but it seems to be right up your alley.
posted by kenzi23 at 8:58 AM on February 22, 2008

Best answer: Assigning a default style with select-all removes some of the formatting you need to keep? (Happens to me, too.)

If you need it really clean, I've done this before with FrontPage: Copy/paste into frontpage, remove the css class rubbish from the code view, copy back from editor view into a fresh Word doc. If a specific formatting doesn't copy over, like small caps, make a macro to change all small caps to strikethroughs or whatever. Then another macro to change back once you're in a fresh doc. It's a clumsy method, but sometimes it's the only way to deal with "bad paragraphs" that lose character formatting when para styles change.

Alternatively, using a macro to apply character styles to your important formatting might let you change the para style to the default without losing any bolds, etc.

I've been dealing with a dysfunctional Word to CMS/Layout workflow for years, so feel free to email if I'm only making half sense.
posted by cowbellemoo at 9:13 AM on February 22, 2008

Response by poster: "Assigning a default style with select-all removes some of the formatting you need to keep?"

Yes, because a "style" includes such attributes as italicization. If you have some text that is in a style, and then you put some in small caps, that text in small caps is now part of a new style (Old Style+Small Caps).

"make a macro to change all small caps to strikethroughs or whatever"

That's a fantastic idea, and I think it might work without FrontPage: I could convert all smallcaps to strikethroughs, save as HTML, then open in Word and convert all strikethroughs to smallcaps.
posted by yesno at 10:18 AM on February 22, 2008

Response by poster: Hum. Actually, there is another reason that HTML doesn't work: It doesn't maintain the footnotes, which is a far worse problem.
posted by yesno at 11:07 AM on February 22, 2008

Ah, right. How bout this:

Convert all your local formatting (bolds, itals, etc.) to character styles. Then go into the Edit>Styles dialog and delete all the paragraph styles. They should default to what a new document would have, and your character styled text should be preserved with the footnotes.

If that doesn't work, I would try doing the same tinkering in OpenOffice.
posted by cowbellemoo at 7:24 AM on February 23, 2008

Response by poster: Thanks for all your help. I think, though, that there is just no *easy* way to do what I want to do.
posted by yesno at 7:13 PM on February 23, 2008

« Older Accommodation and things to do in Valencia, Spain?   |   Identifying which elevator to make a pitch in Newer »
This thread is closed to new comments.