-1

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.

1
  • If you display the Styles Pane wordfaqs.ssbarnhill.com/ManageStyles.htm#StylesPane and set the option to display formatting as a style. Then ask Word to select all text with that formatting for anything showing up in the Styles Pane with a + symbol in it. You could then apply highlighting or shading to the selection. I have no idea how to do this with vba, though. Commented Dec 31, 2022 at 23:04

1 Answer 1

-1

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

2
  • I haven't tried anything yet, as I am hoping for a VBA shortcut. Something along the lines of creating a blank paragraph formatting object and them comparing this to each paragraph.
    – skewray
    Commented Dec 31, 2022 at 22:54
  • There is no such thing as a VBA shortcut for this. The required VBA code for a direct comparison is quite complex. To see what would be required for a direct VBA comparison, see my answer in the link I gave you.
    – macropod
    Commented Dec 31, 2022 at 23:08

Not the answer you're looking for? Browse other questions tagged or ask your own question.