Finding bad formatting

J

John Devlon

Dear people,

For some time now, I'm struggling to solve a VBA problem
Some of you already gave some assistance, for which I'm great full.

I'm trying to find some bad formatting in a word document using VBA.

On all paragraphs are paragraph styles applied. On pieces of some
paragraphs, are Character styles applied. On other pieces of text, other
manual formatting is applied like "bold" or "Bold Italic".

I'm trying to detect the pieces of text that has no "character style"
applied and yet have other manual formatting is applied like "Bold Italic".

For example:
Some text is set to bold, this is wrong.
Other text has the character style "BOLD" applied, this is good.

I need to highlight all the bad formatting

Can anyone please help me?

Thanks

JD
 
W

Word Heretic

G'day "John Devlon" <[email protected]>,

It's incredibly slow as you have to examine each character against the
base definition - I wouldn't bother - buy Word 2003 instead and use
its features to find and remove manual formatting.


Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


John Devlon reckoned:
 
K

Klaus Linke

Hi John,

I do that with a macro like this:
-- Create a new doc,
-- Create all the styles of the original doc in the new doc,
-- But have all character styles look like the "Default Paragraph Font",
and all the paragraph styles look like "Normal".

Now paste the contents of the old doc into the new doc.

All formatting that was done by styles will become invisible, and I can tag the
remaining "bold", "italic" ... that was applied as manual formatting easily.

If you want, you can then paste back into the old doc. The manual formattingf
will be tagged, but the styles and anything else is still in place.

The macro can be found here (in a German group, but the comments in the macro
are in English):

http://www.google.com/groups?threadm=##[email protected]

Regards,
Klaus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top