Template Issues

Keep Word Header Bookmarks Working in Macro-Enabled Documents

Huma Ashraf ChHuma Ashraf Ch Nov 25, 2026 868 views

Question details

Keep automatically populated header bookmarks working when creating a macro-enabled Word document.

Keep Word Header Bookmarks Working in Macro-Enabled Documents
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.
Before you start

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.

Solution 1Recommended

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.

1
Open the source template

In Word, select File > Open and open the template used to create the original document.

2
Check the macro

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.

3
Save as a macro-enabled template

Select File > Save As, choose Word Macro-Enabled Template (*.dotm), and save the template in a location where you can find it.

4
Create a document from the template

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.

5
Save the new document as DOCM

Select File > Save As and choose Word Macro-Enabled Document (*.docm) to save the new document in the required format.

Save the source template as a DOTM file and create a new document
Existing documents: Creating a new document from the DOTM template triggers AutoNew; saving an existing document as DOCM does not run AutoNew by itself.
Free Microsoft Office alternative

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.

Edit document headers in a familiar word-processing interfaceCompatible with Microsoft Word formats, including DOCX and DOCMFree and lightweight for everyday document editingFamiliar tools help users transition from Microsoft Office
microsoft office alternative - wps office

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.