What is the DOCM file format?
A .docm file is a macro-enabled document created by Microsoft Word, introduced with Microsoft Office 2007. The .docm format is closely related to the .docx format - the key difference is that it stores embedded VBA macros, which automate repetitive tasks inside the document. A plain .docx cannot carry macros, so Word automatically saves any macro-bearing document as .docm.
Like .docx, the .docm file is a compressed, ZIP archive-based Open XML package that can contain formatted text, images, shapes, charts, and more. Internally the package includes a word/vbaProject.bin binary part holding the VBA project, alongside the standard XML parts for content and styles.
Applications that can open and edit .docm files include Microsoft Word, LibreOffice Writer, and WPS Office Writer. Google Docs and Word for the web can open .docm files but do not fully execute VBA macros.
Security & safety
RISK: HIGHDOCM is one of the most important formats to treat with caution because it can carry VBA macros that execute code. Macro-enabled Word/Excel documents are a long-standing malware delivery method (e.g. Emotet, dropper "invoice"/"resume" attachments) - the attack works by socially engineering the user into clicking "Enable Content"/"Enable Macros", after which the macro can download and run malware. Defences: (1) since 2022 Microsoft blocks macros by default in Office files that came from the internet (Mark of the Web) - do not bypass that warning for unexpected files; (2) never enable macros on a .docm you did not request, especially if a document that should be plain text arrives as macro-enabled; (3) to read suspicious content safely, open it in Google Docs / Word for the web / LibreOffice where Word VBA does not run, or save it to .docx to strip the macros; (4) keep antivirus and Office updated.
Format details
in a nutshellPrograms that open DOCM files
Technical details
deep spec| MIME type | application/vnd.ms-word.document.macroEnabled.12 |
| Magic bytes | 50 4B 03 04 ("PK" - ZIP local file header, identical to .docx) |
| Container format | ZIP archive (Office Open XML package) |
| Compression | DEFLATE, applied per-entry within the ZIP container |
| Main document part | word/document.xml - UTF-8 WordprocessingML XML holding the document body |
| Macro storage | word/vbaProject.bin - binary OLE2/CFBF container holding the VBA macro project (MS-OVBA format) |
| Content-type declaration | [Content_Types].xml declares the macroEnabled.12 content type, distinguishing .docm from .docx |
| Encryption | Optional password encryption via AES (ECMA-376 Agile Encryption), wrapping the package in an OLE2/CFBF envelope |
| Typical file size | 20 KB - 10 MB; text-only files are small, embedded images and media dominate size |
| Byte order | Little-endian in ZIP fields and the OLE2 VBA storage |
| Integrity checking | ZIP per-entry CRC-32; optional digital signature for the VBA project and/or document package |
| Supported platforms | Windows, macOS, Linux (LibreOffice), web (view-only in most browsers) |
| Relationship to .docx | Structurally identical to .docx; differences are the content-type declaration and the added word/vbaProject.bin part |
| VBA engine | Microsoft Visual Basic for Applications (VBA); same engine used in macro-enabled Excel (.xlsm) and PowerPoint (.pptm) files |
| Maximum archive entries | ZIP limit of 65,535 entries (rarely approached in practice) |
| Encoding | Mixed: UTF-8 XML text parts plus binary OLE2 (vbaProject.bin) within a ZIP container |
| Released | 2007 (Word 2007 / Office Open XML) |
| Latest version | OOXML transitional/strict per ISO/IEC 29500; current Microsoft 365 build of the schema |
| Open standard | Yes · royalty-free |
| Specification | learn.microsoft.com |
DOCM conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about DOCM files.