Benefits of Open XML
When looking at the actual contents of the files themselves, certain advantages immediately become apparent.
Increased Resistance to Corruption
First of all, as anyone who played with the 2007 Microsoft Office beta can attest, the new format delightfully has improved corruption resistance. Even with product evolution during the beta cycle, even with files that became so damaged that Microsoft Office absolutely refused to open them, a developer could still salvage content using the ".zip" trick above.
Another aspect of this is the segmented architecture, with each type of content in a separate part within the package. Microsoft Office writes out the user-entered content first, and optional parts like style information afterward—that way, a truncated document (which is the most common type of externally induced file corruption) may lose some of the formatting but is unlikely to lose content.
Tight File Size
Though file size may not be as much of a consideration on a user level, IT managers should love the compression rate of the zip container, Office PowerPoint, Office Word and Office Excel files all come out smaller—especially handy when you have to send files via email. You'll see a marked difference in file sizes the first time you have to save down to previous Microsoft Office file formats.
Improved Security
Even the sturdiest of souls may give pause to opening .doc files from questionable sources. The new file format, however, handles macros completely differently, by saving documents to an "m" extension if they contain macro code, instead of "x". For example, when someone sends you a ".docm" file, you instantly know what you're getting since, by definition, it's impossible to run a macro in a .docx file. One caveat: Technically, the Open XML format does not include a definition for macro-enabled files such as .docm.
Royalty Free Open Standard
With Ecma standards approval happening in December 2006 (Ecma 376) and ISO/IEC standards approval on the way, Microsoft has shown a commitment to interoperability for the Office Open XML format. It has further demonstrated this commitment by supporting development of Open XML-based applications with a royalty-free promise.
Programmatic Creation and Modification
As previously noted, the Open XML file format gives developers the chance to build Microsoft Office files programmatically, without instantiating, or even installing a Microsoft Office app. But it also gives administrators more power to affect presentation of content. By basing documents on standardized styles, for example, organizations can change the look and feel for all documents at once simply by modifying the originating style. Programmatic access to the underlying content also opens the door for content inspection, such as removing confidential data from outbound documents or macros from inbound documents without impacting the ability to read the file. This all plays a big role in the creation of Office Business Applications, described elsewhere in this article.
Creating Office Files Without Microsoft Office
Knowing that a technology exists doesn't always mean it's easy to create real world solutions with it. Fortunately, in this case Microsoft has paved the way by providing a full set of code snippets and an SDK written specifically for creating and editing Open XML files. Looking through the snippets, you'll see a ton of code for things like "Excel: Get cell value" and "PowerPoint: Get a list of slide titles" and "Word: Convert DOCM to DOCX".
A quick perusal of the snippets code shows a common theme: You can access Open XML documents by instantiating the Package class, as well as other classes in the System.IO.Packaging namespace, such as PackageRelationship and PackagePart.
For example, this is a common start to any Open XML file access code (in C#):
using (Package wdPackage = Package.Open(docName,
FileMode.Open, FileAccess.ReadWrite))
You'll also see statements like the following for loading file content:
XmlDocument doc = new XmlDocument();
doc.Load(documentPart.GetStream());
These are just basic samples, which don't make much sense out of context. Hopefully they demonstrate that XML creation and manipulation isn't an abstract concept but is fully implemented in the .NET Framework 3.0 API. To learn more, start with the snippets, then dig deeper into the Packaging namespace. You should also check out the How to articles attached to the SDK announcement.