Keep Word Header Bookmarks Working in Macro-Enabled Documents
Question details
Keep automatically populated header bookmarks working when creating a macro-enabled Word document.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- A user needs a macro-enabled DOCM document whose header bookmarks are populated automatically from a template.
- Observed behavior
- The goal is for header bookmarks to be populated when a new document is created from the template.
Locate the original Word template and check whether it contains an AutoNew macro that populates the header bookmarks. Only enable macros from a source you trust.
Save the source template as a DOTM file and create a new document
Use this method when an AutoNew macro in the template populates the header bookmarks.
AutoNew runs when a new document is created from a template; merely saving an existing document as DOCM does not trigger it. Confirm that the template contains the macro before relying on this method.
In Word, select File > Open and open the template used to create the original document.
Open the Visual Basic Editor from Developer > Visual Basic and look for an AutoNew macro in the template. Review or update the code that populates the header bookmarks.
Select File > Save As, choose Word Macro-Enabled Template (*.dotm), and save the template in a location where you can find it.
Select File > New and choose the saved template from Personal or Custom, if shown. Allow macros only if you trust the template, then check that the header bookmarks have been populated.
Select File > Save As and choose Word Macro-Enabled Document (*.docm) to save the new document in the required format.

Edit Word Documents with WPS Writer
WPS Office is a free, lightweight alternative with a familiar interface for working with Word documents. Its format compatibility can make migration easier, although it does not fix Word's AutoNew behavior and VBA macro support can vary.

Frequently Asked Questions
Why didn't saving my document as DOCM populate the bookmarks?
Saving an existing document as DOCM does not trigger a template's AutoNew macro. Create a new document through File > New using the macro-enabled template instead.
How can I check whether the template has an AutoNew macro?
Open the template in Word, select Developer > Visual Basic, and look for an AutoNew macro in the template's VBA project.
What format should I use for the template?
Use File > Save As and select Word Macro-Enabled Template (*.dotm) so the template can retain its macros.
What if the DOTM template does not appear under File > New?
Check that the template is saved in Word's configured personal template location, then look under File > New > Personal or Custom. The available labels can vary by Word version.
Should I enable macros when opening the template?
Enable macros only if you trust the template and its source. If macros are blocked, the AutoNew macro may not populate the bookmarks.




