The basics
What is a DOTM file?
A DOTM is a Word template with macros allowed. Like a DOTX, it holds text, styles, page setup and building blocks that new documents start from. Unlike a DOTX, it can also store VBA macros. That makes it the format for two jobs: templates that come with automation, such as a letter that fills in its own fields, and collections of macros that should be available in every document.
- Double-click it, and Word creates a new, untitled document based on it. To edit the template itself, open it from inside Word, or right-click it and choose Open.
- It may hold no macros at all. Microsoft describes it as configured to support macro code, not as always containing it. Our samples have none.
- Templates that look like documents are a known trick. Files that pull in a DOTM from a web server are a common way to slip macros past filters.
Our samples contain no macros
Each DOTM on this page is the macro-enabled template package without a VBA project, safe to open. olevba reports "No VBA or XLM macros found".
Anatomy
What's inside a DOTM file
Inside, a DOTM is a DOCX package with a template content type. This is sample-letter-template.dotm from the samples below: a letter with fill-in fields and no macros. A DOTM with macros would also contain word/vbaProject.bin, explained on the DOCM page.
sample-letter-template.dotm (a ZIP archive: 50 4B 03 04)
[Content_Types].xml
_rels/.rels
docProps/core.xml
docProps/app.xml
word/document.xml the letter, with six content controls
word/_rels/document.xml.rels
word/styles.xml includes the custom "Sender Block" style
word/stylesWithEffects.xml
word/settings.xml
word/webSettings.xml
word/fontTable.xml
word/theme/theme1.xml
customXml/item1.xml
customXml/_rels/item1.xml.rels
customXml/itemProps1.xml
word/numbering.xml
word/footer1.xml
In [Content_Types].xml:
<Override PartName="/word/document.xml"
ContentType="application/vnd.ms-word.template.macroEnabledTemplate.main+xml"/>
A content control in word/document.xml, indented for reading:
<w:sdt>
<w:sdtPr>
<w:alias w:val="Recipient name"/>
<w:tag w:val="recipient"/>
<w:id w:val="4101"/>
<w:text/>
</w:sdtPr>
<w:sdtContent>
<w:r><w:rPr><w:color w:val="808080"/></w:rPr>
<w:t xml:space="preserve">[Recipient name]</w:t></w:r>
</w:sdtContent>
</w:sdt>- 1
50 4B 03 04The ZIP signature
The same as every Word and Excel file since 2007.
- 2
word/document.xmlThe template's content
What every new document starts with: here, a sender block, fill-in fields and a closing. In a template used only for its macros, this can be empty.
- 3
word/styles.xmlStyles
Documents based on the template start with these styles, including custom ones like Sender Block.
- 4
ContentType="application/vnd.ms-word.template.macroEnabledTemplate.main+xml"The template content type
This makes the package a macro-enabled template. In a DOTX the main part says
…wordprocessingml.template.main+xml, in a DOCM…document.macroEnabled.main+xml. Word reads it to decide that double-clicking should create a new document rather than open the file. - 5
<w:sdt>A content control
A field the user fills in. Templates often use them for names, dates and choices.
- 6
<w:alias w:val="Recipient name"/>Title and tag
The alias is the title Word shows on the control; the tag (
recipient) is a name for code. Document automation tools find fields by tag, not by text. - 7
<w:text/>The control type
Plain text here. The sample also has a date picker (
<w:date>) and a drop-down list (<w:dropDownList>). - 8
[Recipient name]Placeholder text
Grey text the user types over.
Normal.dotm
Normal.dotm: the template behind every blank document
Word keeps a Normal.dotm for each user, on Windows and Mac. It opens whenever Word starts, sets the default styles and look of new blank documents, and by default is where Word stores macros you record ("All Documents (Normal.dotm)" in the Record Macro dialog). Changes you make to it apply to documents you create later.
- Where it is on Windows:
C:\Users\<user name>\AppData\Roaming\Microsoft\Templates\Normal.dotm. AppData is a hidden folder. - Resetting it: if
Normal.dotmis renamed, damaged or moved, Word creates a new one with the original settings the next time it starts. Rename it to something likeNormal-old.dotmto get a clean default and keep the old one as a backup. - "Do you want to save changes to Normal.dotm?" on every exit means something changed the template: usually an add-in or a macro, and occasionally a macro virus. Microsoft's own troubleshooting article lists both.
A target for attackers
Macro code added to Normal.dotm runs inside every Word session. MITRE ATT&CK lists this as a persistence technique (T1137.001, Office Template Macros). If you didn't add macros to your Normal template, it shouldn't have any: check it with olevba or the VBA editor (Alt+F11).
Add-ins
Global templates and add-ins
A document is attached to one template, usually Normal. You can also load other templates as global templates, which makes their macros, AutoText and other building blocks available to every document, whatever template it's based on. A DOTM loaded this way is often called a Word add-in.
- Load one for this session: Developer tab, Document Template (or File, Options, Add-ins, Manage: Word Add-ins), then Add. It stays loaded until you close Word.
- Load one every time Word starts: put it in Word's Startup folder, by default
C:\Users\<user name>\AppData\Roaming\Microsoft\Word\STARTUP. The exact path is under File, Options, Advanced, File Locations. - Unload it by unticking it in the same dialog, or removing it from the Startup folder.
Because everything in the Startup folder loads silently with Word, that folder is worth checking when Word behaves oddly. Only global templates you installed on purpose should be there.
Inheritance
What a document created from a DOTM gets
| Part of the template | In the new document? |
|---|---|
| Text, tables, content controls, headers and footers | Copied into the new document. |
| Styles, page setup, numbering | Copied. |
| VBA macros | Not copied. The document stays attached to the template, and the template's macros are available while Word can find it. |
| File type | The new document is saved as .docx by default, even though the template was macro-enabled. |
That is different from Excel, where a workbook created from an XLTM inherits the template's VBA project. In Word, the code stays in the template and the documents link to it.
The link can point elsewhere. A DOCX can name a template on a web server, and Word fetches it when the document opens. Attackers use this remote template injection to bring a macro-enabled template into a document that contains no macros itself; the DOCX page covers it.
Comparison
DOTM vs DOTX, DOT, DOCM and OTT
| Format | What it is | Macros |
|---|---|---|
| DOTM | Word template, ZIP of XML | Allowed |
| DOTX | Word template, ZIP of XML | Not allowed |
| DOT | Word 97-2003 template, binary | Allowed, and the name doesn't tell you |
| DOCM | Word document with macros | Allowed; opens as itself, not as a new document |
| OTT | OpenDocument text template (LibreOffice) | LibreOffice Basic macros allowed |
Use DOTX for templates that only need text and styles, which avoids security prompts and mail filters. Use DOTM only when the template has to carry code.
Security
Is a DOTM file safe?
Treat a DOTM from someone else like any file with code in it. The protections that apply to DOCM documents apply to templates too:
- Mark of the Web. Microsoft's macro-blocking change covers templates and add-ins downloaded from the internet, including
.dotand.dotm, on Office for Windows. - Trusted Locations. Files in a Trusted Location open with macros enabled. Word's own template and Startup folders are usually trusted, which is why copying a downloaded DOTM there bypasses the warnings. Only do it for templates you trust.
- Inspection.
olevba template.dotmlists any VBA modules without running them, and flags auto-run macros such asAutoNew(runs when a document is created from the template) andAutoExec(runs when a global template loads).
How to
How to open, edit and convert a DOTM file
- Use it: double-click, or File, New, Personal in Word if it's in your templates folder. You get a new document based on it.
- Edit it: in Word, File, Open, then pick the
.dotmitself; save it as Word Macro-Enabled Template. - Remove the macros: File, Save As, Word Template (
.dotx). Word leaves out the VBA project. - LibreOffice Writer opens DOTM files, but doesn't run Word VBA the way Word does.
- In code: python-docx's
Document()refuses a DOTM ("is not a Word file"), since it accepts only the DOCX content type. You can open the package at a lower level or change the content type to edit it.
Free downloads
Sample DOTM files to download
Free sample Word macro-enabled templates for testing upload filters, template pipelines and macro scanners. None of them contains macros: each is a valid DOTM package without a VBA project, safe to open. All were checked with unzip -t, by opening the package with python-docx, by converting to PDF with LibreOffice, and with olevba.
Browsers can't show this kind of file in a page. Download it to open it in the app it belongs to.
What's inside sample-letter-template.dotm
Browsers can't preview DOTM files. Download it and double-click it in Word to start a new letter, or open it from inside Word to see the template itself.
Template content type
word/document.xmlis declared asapplication/vnd.ms-word.template.macroEnabledTemplate.main+xml, so Word treats the file as a macro-enabled template.Plain-text content controls
Recipient name, address, subject and body, each with a title, a tag for automation and grey placeholder text.
A date picker
The letter date uses a date content control with the format
d MMMM yyyy.A drop-down list
The greeting is a drop-down with three choices.
A custom style
The sender block at the top uses the Sender Block paragraph style, defined in the template's
styles.xml.No macros
There's no VBA project. A second page explains this; delete it before using the letter.
All sample DOTM files
Letter template with content controls (no macros)
sample-letter-template.dotm · 35.7 KB (36,584 bytes)
A letter template for the fictional Example Studio, signed by Ada Example: six content controls (text, date picker, drop-down), a custom style, a footer and properties. Made with python-docx and given the macro-enabled template content type. No VBA project.
- Testing template upload and "new from template" flows
- Content control parsing in document automation
Minimal DOTM, three parts
sample-minimal.dotm · 1.0 KB (1,072 bytes)
Content types, package relationships and a two-paragraph
word/document.xml, written by hand. The bare minimum: the three parts every Word package needs.- Parser tests against the bare minimum
- Comparing content types with DOCM and DOTX
100 KB DOTM file
sample-100kb.dotm · 100 KB (102,400 bytes)
The letter template, padded to exactly 102,400 bytes with whitespace inside
docProps/app.xml, stored uncompressed. No macros.- Upload and size-limit tests
- Checking type-based filters for templates
Ways to test with them
- New from template: double-click
sample-letter-template.dotmin Word. You should get an untitled document, not the template, and saving it should offer.docx. - Content controls: read the controls by tag (
recipient,address,date,subject,greeting,body) and check your tool finds all six, including the date picker and drop-down. - File type detection: a detector that reads
[Content_Types].xmlshould report a macro-enabled Word template for all three files, not DOCX or DOCM. - Macro scanners and filters:
olevbashould find no VBA. A filter that blocks macro-enabled types will still block these, by design. - Size limits:
sample-100kb.dotmis exactly 102,400 bytes.
Free to use for testing, teaching and demos, commercially or not, with no attribution needed. A link back to this page is always appreciated.
Put it online
Have a DOTM file? Give it a link.
Drop a Word macro-enabled template on 99helpers and it gets its own link. Visitors download it and open it in Word; if it has macros, Word on Windows blocks them because the file came from the internet, so share a DOTX if the template doesn't need code.
Questions
DOTM files, frequently asked
What is a DOTM file?
A Microsoft Word template that can contain VBA macros. Double-clicking it creates a new document based on it; loaded as a global template, it makes its macros available in every document.
What's the difference between DOTX and DOTM?
A DOTM can store macros and a DOTX can't. Both are Word templates in the same ZIP-of-XML format.
What is Normal.dotm?
The template Word uses for new blank documents. It opens whenever Word starts, holds your default styles and, by default, the macros you record.
How do I reset Normal.dotm?
Close Word, then rename Normal.dotm in %AppData%\Microsoft\Templates. Word creates a new one with the default settings the next time it starts.
How do I edit a DOTM template instead of creating a new document?
Open Word first, then use File, Open and choose the template, or right-click the file and choose Open. Double-clicking always starts a new document.
Do documents created from a DOTM contain its macros?
No. Word doesn't copy the VBA project into new documents, which are saved as DOCX by default. The macros stay in the template, and the document can use them while it's attached.
Is a DOTM file safe to open?
Only if you trust where it came from, because it can contain macros. Office on Windows blocks macros in templates downloaded from the internet; check unknown files with olevba before using them.
How do I load a DOTM as an add-in?
In Word, Developer, Document Template, Add, then pick the file. To load it every time Word starts, copy it into Word's Startup folder.
Related formats
Other file types explained
Keep going
Related
Sources
- Microsoft Learn: XML file name extension reference for Office
- Microsoft Support: Change the Normal template (Normal.dotm)
- Microsoft Support: Load or unload a template or add-in program
- Microsoft Support: Prompted to save changes to Normal.dotm every time you quit Word
- Microsoft Learn: Macros from the internet are blocked by default in Office
- MITRE ATT&CK: Office Template Macros (T1137.001)
Last reviewed 27 October 2026.