Cookies for analytics and advertising
We use cookies for analytics and advertising, both sent to Google. Refusing changes nothing you can see.Read the privacy page
DOCM
A Word document carrying macros. Converting it to PDF is often the point — the macros do not come along.
DOCM
DOCM is a container: a wrapper that holds streams encoded by something else. It is used for editing.
The extension is .docm, and the full name is Word Macro-Enabled Document. Both matter less than what the file can hold, which is what the rest of this page is about.
Microsoft published it in 2007. The specification is ECMA-376.
Age is worth knowing here for one practical reason: the older a format is, the more programs have had time to learn it.
It is published in full, so anyone can implement it from the document rather than by inspection, which is why it turns up in so many programs and why files written twenty years ago still open. A published specification is not the same thing as a royalty-free one: where a format wraps a codec, the patent licensing is a separate question the standard does not settle.
DOCM is not limited to one page, which matters when converting to something that is: one conversion produces one file holding a single page — the first one, unless the page is something the converter lets you pick.
DOCM is allowed to carry executable code, and that is usually the reason somebody meets this extension at all: a mail gateway or a document portal rejected it. Converting to a format without macros is the usual way past that, and it does mean the macros are gone.
DOCM holds a text document: paragraphs that reflow to fit whatever page they land on.
That is what decides how it converts: the text reflows, so page numbers are a property of the output rather than of the file.
Microsoft Word reads it, and so do most programs of the same kind.
If a file will not open, the format is rarely the problem — it is more often that the program predates it. Converting to something older is the reliable way past that, and it is what the rest of this site is for.
No browser reads it.
That is the single most common reason to convert it: not that the format is bad, but that the place you want to show the file cannot read it.
DOCM is meant to be opened and changed. Keep the file in this format for as long as the work is going on, and export from it whenever a finished copy is needed.
DOCM and DOCX are the same format — a ZIP package of XML holding the text, styles and images — with one difference: a DOCM may contain a VBA project and a DOCX may not. The extension exists to make that visible before the file is opened.
Where this differs from spreadsheets is how often it is justified. A macro-driven workbook is a normal piece of office automation; a macro-driven *document* is much rarer. Templates that fill in fields, generate a letter or enforce a house style are the legitimate cases, and they are a small fraction of the DOCM files in circulation.
It is worth being direct. Macro-bearing Word documents were, for the better part of a decade, the single most effective malware delivery mechanism in existence — an invoice, a delivery note, a CV, a document claiming to need macros enabled to display correctly.
The phrase "enable content to view this document" is the tell. A real document does not need macros to be readable; the text is in the XML and Word renders it whether or not any code runs. Any file that says otherwise is describing what it wants you to do rather than how documents work.
Office now blocks macros outright in documents that came from the internet or an email attachment, rather than offering an enable button. Windows marks such files with a zone flag, and Word refuses the code with a red banner and a link explaining why.
The effect was measurable, and so was the response: attackers moved to other file types. For legitimate documents, the fix is to unblock the file in its properties or to keep it in a folder configured as a trusted location — both of which are deliberate acts by somebody who knows where the file came from, which is the point.
Corporate templates that insert a letterhead, populate fields from a database, enforce numbering, or produce a document from a form. Legal and financial firms in particular have deep investments in these, and they work.
Note that a template is usually DOTM rather than DOCM — the macro-enabled template format — because the intended use is to start new documents from it rather than to circulate it. A finished document that carries macros is a slightly odd object, and asking why it does is a reasonable question rather than a paranoid one.
Saving as DOCX drops the VBA project and keeps the text, styles, images, tables, headers, footers and everything else. Word warns first. For a document you have been sent and only need to read, this is the right move and takes a second.
Converting to PDF goes further and is the better answer for anything final. A PDF cannot execute code at all, it fixes the layout, and it is what most recipients would rather have received in the first place. If you are sending a document that happens to live in a macro-enabled template, exporting a PDF is both safer and more considerate than passing the DOCM on.
Rename it to .zip and open the archive. The text and formatting are readable XML, so you can see what the document actually says without Word ever executing anything. The VBA project is a binary stream and will not be readable there, which is itself informative: a document whose macro blob is large is doing something substantial.
To read the code, the VBA editor in Word or LibreOffice will open it without running it. For an unfamiliar file from an unknown sender, the honest advice is simpler: do not open it at all, and ask the sender what it is for.
Ask whether the recipient actually needs the automation. If they only need the content, send DOCX or PDF and the whole question disappears — and their mail gateway is considerably less likely to quarantine it, which many now do for macro-enabled attachments.
If the automation is the point, send it through a channel where the file is not marked as internet-sourced: a shared drive, an internal document library, a package deployed by IT. Emailing a DOCM and then telling the recipient how to unblock it is teaching a habit that the 2022 change exists to break.
| Extension | .docm |
|---|---|
| Media type | application/vnd.ms-word.document.macroEnabled.12 |
| Published by | Microsoft |
| First published | 2007 |
| Specification | ECMA-376 |
Only that a DOCM may contain VBA macros and a DOCX may not. Both are ZIP packages of XML holding the same text, styles and images. The separate extension exists so a recipient sees before opening that the file claims to contain code.
Opening it with macros disabled is as safe as any document — the text renders from the XML without any code running. Enabling the macros is the decision, and VBA has full access to the file system and the network. Enable only for files whose origin you know.
No. That phrase is the classic tell: a real document does not need macros to be readable, because Word renders the text whether or not any code runs. A file claiming otherwise is describing what it wants you to do.
Save it as DOCX. The VBA project is discarded and the text, styles, images, tables, headers and footers are all kept. Word warns before doing it, and that warning is the whole operation.
Since 2022 Office refuses macros outright in files marked as coming from the internet, rather than offering an enable button. For a legitimate file, unblock it in the file properties or keep it in a trusted location — both of which require knowing where it came from.
Rename it to .zip and open the archive — the text and formatting are readable XML. The macro is stored as a binary stream and will not be readable there, but its size alone tells you whether the document is doing something substantial.