Search code examples
vbams-wordformattingstylesparagraph

VBA to highlight all paragraphs with direct (non-style-based) formatting


I would like to write a VBA macro that highlights all paragraphs that have any kind of formatting applied, causing those paragraphs to not match their style.

Then I want to highlight in a different color all text with altered font applied. This would allow me to see all the horrible mangling someone else did to a document, since many Word users ignore styles. I can probably muddle through most of the VBA required, but I have not found a snippet for specifically selecting directly formatted objects.


Solution

  • What have you tried?

    Pressing Ctrl+A, Ctrl+Q, Ctrl+Spacebar will return all text to the paragraph and font settings prescribed by the corresponding Styles. If you then save that document with a new filename and use Word's document comparison tools, that will show you all the formatting differences between the two.

    Do note, though, that the process removes formatting applies by character Styles, too.

    Simple as - and no code required. That said, see also: https://answers.microsoft.com/en-us/msoffice/forum/all/print-applied-document-formatting-not-real-styles/e291f11e-7e07-47d8-be7f-22677cdb4ac0