Question

In Word 2007, a user may update the applied styles by selecting the "Reset to Quick Styles from XYZ Template" in the Change Styles menu option.

Reset to Quick Styles from XYZ Template

Does anyone know of a way to automate this? I tried adding a macro to the Document_Open() method in the VBA for the Template project, but it errors out.

Was it helpful?

Solution

When you record a macro of the 'Reset to Quick Styles from xxx Template', Word generates the VBA code:

WordBasic.ApplyQFSetTemplate

I couldn't get this command to work either, nor find anything Word VBA docs about it. Instead, use the following command when the correct template is attached:

ActiveDocument.UpdateStyles

That one does work consistently!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top