logo
search
Template Issues

How to Create Macro-Enabled DOCM Files from Templates in Word

Aamir Naveed AkramAamir Naveed Akram Oct 9, 2026 872 views

Question details

The user wants to generate new documents from a macro-enabled Word file while keeping the macros functional and preventing accidental modifications to the source file.

How to Create Macro-Enabled DOCM Files from Templates in Word
Product
Microsoft Word
Device & OS
not provided
Scenario
Creating a new document from a macro-enabled source file via File > New, with the intention of retaining the VBA project in the newly generated file.
Observed behavior
When creating a new file from a macro-enabled document, Word preserves the VBA project temporarily but defaults to saving the new document as a standard macro-free DOCX file, requiring manual intervention to save it as DOCM.
Before you start

Ensure the Developer tab is enabled in your Word ribbon to manage macros easily, and verify that your VBA code is thoroughly tested before saving it as a master template.

Solution 1Recommended

Save the Source File as a Macro-Enabled Template (DOTM)

Saving your macro-enabled file as a DOTM template allows you to safely generate new documents containing the macros without risking accidental changes to the original source file.

To prevent users from overwriting the source file, it must be converted into a template format. Microsoft Word uses the DOTM extension specifically for templates that contain VBA macros. When a new document is created from a DOTM file, the macros are loaded into the new document seamlessly.

1
Open the Macro-Enabled File

Launch Microsoft Word and open your existing macro-enabled document (.docm).

2
Save as DOTM

Navigate to File > Save As. In the 'Save as type' dropdown menu, select 'Word Macro-Enabled Template (*.dotm)'. Word will automatically redirect you to the Custom Office Templates folder. Click Save.

3
Create a New Document

Go to File > New, click on the 'Personal' or 'Custom' tab, and select your newly created DOTM template. A new document will be generated with the macros intact.

4
Save the New File as DOCM

When you are ready to save the new document, go to File > Save As. You must manually select 'Word Macro-Enabled Document (*.docm)' from the dropdown to ensure the macros are not stripped out upon saving.

Save the Source File as a Macro-Enabled Template (DOTM)
Default Save Behavior: Even when generated from a DOTM template, Word defaults to saving the resulting document as a standard DOCX file. You must explicitly select DOCM during the first save if you want the macros to remain enabled in the new file.
Free Microsoft Office alternative

Manage Macro-Enabled Documents Seamlessly with WPS Office

If you frequently work with DOCM and DOTM files, WPS Office offers a highly compatible, free, and lightweight alternative to Microsoft Office. It seamlessly supports VBA macros and templates while providing a familiar interface that makes migrating effortless.

  1. 1. Download and Install: Download WPS Office from the official website and follow the easy installation instructions.
  2. 2. Open WPS Writer: Launch the application and open WPS Writer, the word processing module.
  3. 3. Load Your Macro File: Click on Menu > Open and select your DOCM or DOTM file to continue editing your macros seamlessly.
Fully compatible with Microsoft Office formats including DOCX, DOCM, DOTX, and DOTM.Free, lightweight, and fast-loading alternative to Microsoft Word.Familiar ribbon interface ensures zero learning curve for new users.Robust support for complex document formatting, VBA macros, and templates.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Word save my macro-enabled template as a DOCX by default?

By design, Microsoft Word assumes most new documents created from templates do not need to contain the macros themselves. To protect against macro viruses, it defaults to the safer, macro-free DOCX format unless you explicitly choose DOCM.

Can I force Word to automatically save new files as DOCM?

You cannot easily force Word's default Save dialog to select DOCM for a specific template without writing a specialized macro (such as intercepting the FileSave command) to override the default save behavior.

What is the difference between DOCM and DOTM?

DOCM is a standard Word document that contains macros and is used for editing and saving content. DOTM is a Word template file that contains macros, intended to be used as a master starting point (via File > New) to generate multiple identical documents without modifying the original source.