Convert DOCM to PDF

Converting DOCM to PDF is how you deliver a macro-enabled Word document to somebody who will not run macros. A `.docm` is a DOCX allowed to carry a VBA project, and that single difference is what makes mail filters quarantine it. A PDF cannot execute anything, so it passes — and nothing here runs the macro, so the PDF shows the document as it was last saved.

  • Where it runs On our server, because a browser cannot run the software this needs.
  • Rebuilt PDF works differently from a DOCM, so this is not the gradual degradation a lossy codec applies. What PDF can express is reproduced faithfully; what it has no equivalent for does not survive at all.
  • File size limit Up to 25 MB per file, free, without an account.
  • Worth knowing Layout is reproduced with metric-compatible substitute fonts. Macros, comments and tracked changes are not carried over.

Up to 100 files at once. Mixed formats are fine.

What a .docm is and why the extension exists at all

When Microsoft introduced the ECMA-376 formats in 2007 it split what had been one file type into two. A `.docx` is forbidden to contain a VBA project; a `.docm` is the same ZIP-of-XML container with permission to carry one. The registry records exactly that distinction — `macros: false` for DOCX and `macros: true` for DOCM — and it is the whole reason the second extension was invented.

The split was made so that software could tell the difference without opening the file. Before it, every Word document was potentially a program, and every mail filter, upload gateway and antivirus scanner had to treat them all as suspect. Afterwards a policy can say "DOCX yes, DOCM no" and be enforced by looking at four characters. That is enormously convenient for administrators and it is why your attachment disappeared.

The macro a document usually has, and why it is not calculation

Word macros do a characteristic kind of work, and it is worth naming because it decides what the PDF will contain. Most of them assemble: a template that builds a contract from selected clauses, a report generator that pulls figures in and formats them, a letter system that fills the address block and the reference number, a form that shows and hides sections depending on answers. The macro is a construction step that runs before the document is a document.

That is different from a spreadsheet, where the code usually operates on data that is already sitting in the file. It has a direct consequence here: if the macro has already run and the result was saved, converting gives you the finished document. If it has not — if the file is the template rather than an instance of it — the PDF shows placeholders and empty sections, correctly, because that genuinely is what the file contains. Open it in Word, let it build, save, and convert what was saved.

Nothing is executed on the way to the PDF

The conversion hands the file to LibreOffice running headless and asks for a PDF through its export filter. That path does not execute a VBA project, and it could not usefully do so — LibreOffice does not run Word’s macro language natively. Each job also gets its own freshly created LibreOffice profile, which exists for a different reason but has the same effect: nothing persists from one conversion to the next.

So the PDF is a rendering of the last saved state, and that is a guarantee rather than a limitation. It means converting a `.docm` you were sent and do not trust is a safe way to read it: whatever the macro was for, it does not get a turn. It also means the PDF is only as complete as the document was when it was written to disk, which is the point made above and the single thing most likely to surprise somebody converting a template by mistake.

The yellow bar, Protected View, and what the recipient avoids

Sending a `.docm` puts the recipient through a sequence of decisions you would rather they did not have to make. Word opens a file from outside the organisation in Protected View; if they choose to enable editing, a second bar appears asking whether to enable content, which is the prompt that turns the macros on. Many organisations now block macros from the internet outright, so the bar says the file has been blocked and offers no way through.

None of that is about your document. It is a blanket response to a decade in which macro-bearing attachments were the main delivery route for malware, and it applies whether the macro is a mail-merge helper or something worse. A PDF removes the whole conversation: it opens in the reader, in the browser, on a phone, in a preview pane, and nobody is asked to make a security decision about your contract on your behalf.

Fields, content controls and everything that stops being live

A PDF is a fixed page, so anything that was still calculating in the Word document resolves to its current value and stays there. Dates that updated themselves, page counts, cross-references, a table of contents, sequence numbers on figures and tables, DOCPROPERTY fields: each is frozen at the moment of conversion. Content controls and structured document tags become the text they were displaying.

That is usually the point — a filed or published document should not change after it is filed — but it is worth one deliberate check first. Update the fields and the table of contents in Word immediately before converting, so that what is frozen is correct rather than merely current. If any field was being populated by the macro rather than by Word, this is the case where an unrun macro leaves a visible gap in the PDF, and it is easier to see now than after the document has been sent.

Fonts and layout across the two engines

The document is rendered by LibreOffice rather than by Word, so the layout is reproduced rather than reproduced identically. In practice it holds up well, because the converter carries metric-compatible substitutes for Arial, Times New Roman, Courier New, Calibri and Cambria — faces with the same character widths as the originals, so line breaks fall in the same places and a page laid out to fit still fits.

The risk is concentrated in unusual fonts. A brand face or a downloaded font that the document names but does not embed will be substituted with something of different widths, and text can reflow enough to push a line onto the next page. Documents assembled by a macro are more exposed than most, because template authors tend to be fond of a house typeface. If the document has a fixed layout that matters — a certificate, a form, a contract with numbered clauses on specific pages — look at the PDF page by page rather than at the first page only.

When a DOCX is a better answer than a PDF

If the recipient has to edit the document, converting to PDF solves the security problem and creates a usability one. The better move is to save the file as `.docx` in Word: the format cannot hold a VBA project, so saving to it strips the macros while leaving an editable document that no filter will quarantine. Word will warn you that the project will be lost, which is exactly what you want.

Choose between the two by what happens next. Reading, printing, filing, publishing, attaching to a record — PDF, because it is fixed and universal and nothing about it can change. Editing, reviewing with tracked changes, filling in, or continuing the work — DOCX. Sending the `.docm` itself is the option to avoid unless the recipient specifically needs the automation and is expecting it, in which case a shared drive is a better delivery route than email.

Where a macro-enabled document is converted

On our server, not in your browser. Rendering a Word document to PDF needs a real office engine, and this page says so plainly rather than implying that everything on this site runs on your own device. The file travels over an encrypted connection to a container running LibreOffice headless, and that container is configured with no outbound internet access of its own — which for a file whose whole subject is untrusted code is worth stating explicitly.

Each job gets its own scratch directory and its own LibreOffice profile, and the directory is deleted when the job finishes regardless of the outcome. Two `soffice` processes sharing a profile corrupt it, and the symptom is a conversion that never returns rather than an error, which is why the profile is per job. Anything still running after sixty seconds is terminated. The free tier accepts 25 MB per uploaded file.

Checking the PDF against what the document was meant to say

Read the PDF before it goes anywhere, and read it looking for absence rather than for damage. The characteristic failure of this conversion is not a mangled table, it is a section that should have been filled and is not, because the thing that fills it never ran. Empty address blocks, a reference number still showing its placeholder, a clause list with nothing in it, a total that reads zero.

Then check the page count and the last page. Documents assembled from templates tend to have carefully placed signature blocks and page-numbered schedules, and a font substitution that moves one line can push a signature onto a page of its own. If the same template is converted regularly, checking one output carefully tells you what to expect from all of them — the failures come from how the template was built rather than from any individual document.

How to convert a macro-enabled DOCM to PDF

  1. Open the DOCM in Word first if a macro is meant to build its contents, then save it.
  2. Drop the file onto this page — LibreOffice renders it to PDF on the server, running nothing.
  3. Read the PDF for empty sections and check the page breaks before sending it.

DOCM and PDF: a document that can run code, and one that cannot

DOCM compared with PDF
DOCMPDF
Full nameWord Macro-Enabled DocumentPortable Document Format
File extension.docm.pdf
Media typeapplication/vnd.ms-word.document.macroEnabled.12application/pdf
CompressionEither, depending on the setting
First published20071993
Published byMicrosoftAdobe
SpecificationECMA-376ISO 32000-2
LicensingOpen standardOpen standard
Standing todayCurrentCurrent
Colour it can describeRGB, CMYK, greyscale
Opens in a browserNo browserEvery browser
Considered insteadDOCXDOCX, HTML

What is lost

The document becomes a fixed page: PDF stores how it looks rather than how it was built.

DOCM can carry macros and PDF cannot. The code is discarded rather than converted — which is usually the point, since a macro-enabled file is the one an email gateway or a corporate policy refuses.

What survives

Both DOCM and PDF hold several pages, so a multi-page document stays one file.

Opening the result

PDF opens in every current browser. DOCM has narrower browser support than that. If the file is going onto a web page or into a form, that is usually the whole reason for the conversion.

The usual programs do not overlap: DOCM opens in Microsoft Word, PDF in Adobe Acrobat, Preview and LibreOffice Draw — so whoever receives the result needs something from the second list.

What each format is for

The two are aimed at different work: DOCM at editing, PDF at handing a finished file over, print and archiving. That is worth weighing before converting, because the reason one exists is usually the reason the other is awkward.

DOCM is Microsoft's format, published in 2007. The specification is ECMA-376, and it is worth reading if the file has to outlive the tool that wrote it.

PDF comes from Adobe and dates from 1993, specified as ISO 32000-2. Adobe Acrobat, Preview and LibreOffice Draw all read it.

DOCM to PDF: blocked attachments, macros and what is rendered

Are my DOCM files uploaded anywhere?

Yes — this conversion needs software that cannot run in a browser, so the file is uploaded over an encrypted connection. It is deleted as soon as the job finishes, and the result is sent straight back to you without being stored. The work is done by LibreOffice, the full office suite, running headless.

Are the macros run during the conversion?

No. The document is passed to LibreOffice in headless mode with a fresh profile for the job and converted through its export filter; nothing in that path executes a VBA project. The PDF is a rendering of the document as it was last saved.

Why was my .docm attachment blocked when a .docx goes through?

Because the extension is the signal. A DOCX cannot contain macros at all — the format forbids it, which is why Microsoft split the two in 2007 — so mail filters and upload gateways can allow one and quarantine the other without inspecting anything. A PDF is on the permitted side of the same line.

The document looks empty or half-finished in the PDF. Why?

Because its content was being produced by the macro. If a `Document_Open` routine fills in fields, pulls in data or assembles sections, none of that runs here, so the PDF shows the template state. Open the document in Word, let the macro do its work, save, and convert the saved result.

Can I get a macro-free Word document instead of a PDF?

Yes, by saving it as `.docx` in Word — the format cannot hold a VBA project, so saving to it removes the macros and keeps an editable document. Choose that when the recipient still needs to edit; choose PDF when they need to read, print or file it.

Do comments and tracked changes appear in the PDF?

No. The export produces the document as it would print, so comments, tracked changes and hidden text are left out. If a reviewer needs to see them, send them the document rather than a PDF of it.

What is the size limit and where does the file go?

25 MB per file on the free tier. This pair runs on our server rather than in your browser, because rendering a Word document to PDF needs a real office engine; the file goes over an encrypted connection and is deleted as soon as the job finishes.

More about these formats

Where these figures come from

The claims this page makes about DOCM and PDF are checkable, and these are the documents that settle them.