.docx Versus .docm

With Word 2007 comes not one new format, but two—or four, depending on how you count:

  • .docx— An ordinary document containing no macros

  • .docm— A document that either contains macros or is macro enabled

  • .dotx— A template that does not contain macros

  • dotm— A template that either contains macros or is macro enabled

It is important for some purposes for users to be able to include macros not just in document templates, but in documents as well. This makes documents that contain automation a lot more portable. Rather than having to send both document and template, or worse, a template masquerading as a document, you can send a document that has macros enabled.

Note

When Word macro viruses first started appearing, ordinary Word documents could not contain macros—only templates could. Therefore, one of the most popular ways of “packaging” macro viruses was in a .dot file that had been renamed with a .doc extension. The virus itself often was an automatic macro (typically, AutoExec) that performed some combination of destruction and propagation when the rogue .dot file was first opened. A common precaution was to press Shift as you opened any Word file— .doc or .dot —to prevent automatic macros from running. In fact, even with various advances in security and antivirus software, pressing Shift when you open an unfamiliar Word document is still not being overcautious. In recent versions of Word, .doc files can legitimately contain macros, so I’m not really sure the situation ...

Get Office 2007 Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.