What is the DOTM file format?
A .dotm file is a Microsoft Word Macro-Enabled Template - the macro-carrying member of the Word Open XML template family introduced with Office 2007. It combines the template behavior of .dotx (macro-free template) with the VBA macro capability of .docm (macro-enabled document).
Like all Office Open XML files, a .dotm is a ZIP archive beginning with the standard PK signature (50 4B 03 04). It is distinguished internally by [Content_Types].xml declaring the application/vnd.ms-word.template.macroEnabled.12 content type, and by the presence of word/vbaProject.bin - an OLE2 binary stream carrying all VBA macro code. Other package parts - word/document.xml, word/styles.xml, word/settings.xml - are standard UTF-8 XML.
The defining behavior: double-clicking a .dotm file creates a new, untitled document based on the template, leaving the template itself unchanged. To edit the .dotm directly, use File > Open or right-click > Open in Word.
Since 2022, Microsoft blocks macros by default in Office files downloaded from the internet (Mark of the Web enforcement), including .dotm templates. Macros run without prompting only when the file resides in a designated Trusted Location or Trusted Templates folder. .dotm files are widely used in corporate environments to deploy shared styles, boilerplate text, and automation - such as document assembly or mail-merge logic - via a centrally managed template path. LibreOffice Writer offers partial VBA compatibility; complex macros may require adjustments.
Security & safety
RISK: HIGHDOTM carries VBA macros and is a high-risk file format. Key threat: 'template injection' attacks embed a DOTM reference in a seemingly benign DOCX, which downloads and executes malicious VBA silently on opening. Direct DOTM phishing lures prompt users to 'Enable Content'. Defences: (1) since 2022 Microsoft blocks macros by default in internet-sourced Office files - do not bypass the Mark of the Web warning; (2) never click 'Enable Content' on a DOTM you did not expect or request; (3) open suspicious DOTM files in Google Docs, Word for the web, or LibreOffice - Word VBA does not run in these environments; (4) inspect the file by renaming to .zip and examining vbaProject.bin with a tool like olevba (python-oletools) before running. DOTM poses greater risk than DOCM because macros in templates can persist across sessions and auto-execute on document creation.
Format details
in a nutshellPrograms that open DOTM files
Technical details
deep spec| Encoding | Binary (ZIP) containing UTF-8 XML parts and a binary OLE2 VBA storage |
| Magic bytes | `50 4B 03 04` (`PK`) at offset 0 - standard ZIP local file header |
| Byte order | Little-endian (ZIP fields and embedded OLE2 VBA storage) |
| Container | ZIP archive (Office Open XML package) |
| Compression | DEFLATE per ZIP entry |
| VBA project storage | `word/vbaProject.bin` - OLE2/CFBF binary embedded inside the ZIP; contains all macro code and module definitions |
| Content type | `application/vnd.ms-word.template.macroEnabled.12` (declared in `[Content_Types].xml`) |
| Double-click behavior | Creates a new untitled document from the template; the `.dotm` itself is not opened for editing |
| Encryption method | AES via ECMA-376 Agile Encryption when password-protected; wraps the ZIP package inside an OLE2 envelope |
| Digital signature | VBA project code signing supported; optional OOXML package-level digital signature also available |
| Macro security | Blocked by default since 2022 for internet-sourced files (Mark of the Web); unrestricted only from Trusted Locations |
| Key package parts | `[Content_Types].xml`, `word/document.xml`, `word/styles.xml`, `word/settings.xml`, `word/vbaProject.bin` |
| Typical file size | 20 KB - 5 MB (simple macro template; larger with embedded images or extensive VBA modules) |
| Released | 2007 (Word 2007 / Office Open XML) |
| Latest version | OOXML ISO/IEC 29500 (current Microsoft 365 schema); VBA macro project per MS-OVBA |
| Open standard | Yes · royalty-free |
| Specification | learn.microsoft.com |
DOTM conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about DOTM files.