How to Create Macro-Enabled DOCM Files from Templates in Word
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.

- 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.
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.
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.
Launch Microsoft Word and open your existing macro-enabled document (.docm).
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.
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.
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.

Add Document Type Verification Logic to Open Macros
If you have macros that run automatically upon opening the document, you should add logic to ensure they only execute when the appropriate file type is opened.
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. Download and Install: Download WPS Office from the official website and follow the easy installation instructions.
- 2. Open WPS Writer: Launch the application and open WPS Writer, the word processing module.
- 3. Load Your Macro File: Click on Menu > Open and select your DOCM or DOTM file to continue editing your macros seamlessly.

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.




