top of page
  • Phil

Resetting corrupted styles in your Word documents

Ok, so you have done the right thing, setting up styles in your Word template and creating documents based on it. Why is it then, that these documents occasionally seem to take on a mind of their own; style properties are no longer what was set up in the template, they have mutated!


This can happen with documents as they are being populated, usually as a result of cutting and pasting something into your document that still has formatting or style data embedded within it. Indentation and paragraph spacing seem to be particularly susceptible to corruption.

So, how do you get your styles back to how they were setup in the initial template without updating them all manually, or creating a new ‘clean’ document, pulling all the content into it and reformatting the whole thing?

Here is a piece of macro code that will do it for you:


ActiveDocument.CopyStylesFromTemplate Template:=ActiveDocument.AttachedTemplate.FullName


Running this code will copy all the styles from the attached template, back into your document and should fix any anomalies.


If you don’t want to get involved with such witchcraft, but would like to see how a bit of magic could transform the way you and your team produce documentation (without even knowing that it’s actually macro functionality doing the work behind the scenes), feel free to get in touch. You’ll be surprised by what is possible.

7 views0 comments

Comments


bottom of page