openxml Using Open XML SDK 2.5 Productivity Tool


Example

Reading the specification for the document formats in OpenXML can be a time consuming process. Sometimes you just want to see how to produce a certain feature in a word-document. The Open XML SDK 2.5 Productivity Tool for Microsoft Office (OpenXmlSdkTool.exe) does just that. Its main features are:

  • See the structure of a file - which xml-parts does it contain
  • Navigate the xml in each of these parts
  • Generate c#-code for producing the selected part of the document
  • Link to the file format specification describing more details
  • Document OpenXML Validation

For a simple 'Hello world.docx' it looks like this: enter image description here The pane on the left show the document-structure. The top-right pane displays the xml corresponding to the selection in the tree, and finally the bottom-right pane show some generated code for producing the xml displayed above it.

This enables a very hands on way to investigate a certain feature:

  • Produce an example-document (fx a word-document)
  • Open the document in Productivity Tool
  • Use 'Reflect Code' to generate code

The SDK can be downloaded from https://www.microsoft.com/en-us/download/details.aspx?id=30425 - download and install both of the msi packages. After installation use OpenXMLSdkTool.exe installed in "C:\Program Files (x86)\Open XML SDK\V2.5\tool".