Open-Xml-PowerTools Developer Center

ReturnOpen-Xml-PowerTools v4.0 provides guidance and example code for programming with Open XML Documents (DOCX, XLSX, and PPTX). It is based on, and extends the functionality of the Open-Xml-Sdk.

At one level, PowerTools for Open XML consists of PowerShell cmdlets that enable you to process Open XML documents in interesting ways. At a deeper level, PowerTools provides C# source code that shows how to implement some interesting functionality using Open XML.

It supports scenarios such as:

The following developer centers contain screen-casts, blog posts, and more to help you get going.

Open XML Installation Center List of blog posts and screen-casts that contain the most recent information on installing important tools and libraries for Open XML development.
DocumentAssembler DocumentAssembler is a high-performance tool for generating customized documents from a template DOCX and any data source that can be serialized as XML.
DocumentBuilder DocumentBuilder enables you to split apart and combine DOCX files in a variety of ways.
PresentationBuilder PresentationBuilder enables you to split apart and combine PPTX files in a variety of ways.
WmlToHtmlConverter Transforms DOCX => HTML/CSS with reasonably high fidelity.
HtmlToWmlConverter Transforms HTML/CSS => DOCX with reasonably high fidelity.
OpenXmlRegex Search and replace in DOCX & PPTX using regular expressions.

PowerTools for Open XML was first released in June, 2008. Some of the content listed below applies to version 1.0, 2.0, or 2.2 of PowerTools for Open XML. In many cases, that content is still relevant to PowerTools for Open XML 3.0 and 4.0, so you may find it interesting to review that material.

PowerTools for Open XML 3.0

Introduction to PowerTools for Open XML 3.0 The key enhancement for PowerTools for Open XML version 3.0 is that Cmdlets are now written using PowerShell script rather than C#. This makes it far easier to develop new ones and to enhance existing ones.  Follow the link to the left for a screen-cast that shows how to get started with this new version of PowerTools.
Installation Instructions for version 3.1.00 and later. Detailed instructions and 8-minute screen-cast that shows the new, easier way to download and install PowerTools for Open XML.
Screen-Cast: Writing PowerShell Cmdlets using PowerShell Script This screen-cast explains the various techniques and coding patterns that we want to follow when implementing PowerTools for Open XML Cmdlets using PowerShell script. Shows how to write Cmdlets that create Open XML documents, query Open XML documents, and modify Open XML documents.
Convert-DocxToHtml Demonstrates the Convert-DocxToHtml Cmdlet. Shows conversion of Chinese, Hebrew, and English documents to HTML.
Using the ConvertTo-Base64 and ConvertFrom-Base64 Cmdlets Sometimes we need to use a ‘template’ or ‘source’ Open XML document from within our C#, VB.NET, PowerShell, or JavaScript program. One convenient way is to convert the binary Open XML file to base 64 encoded ASCII, and to embed the document in our program as a string literal. This video explains why we want to do this, and explains the ConvertTo-Base64 Cmdlet that makes it easy for us to write this variety of code.
Using the ConvertTo-FlatOpc and ConvertFrom-FlatOpc Cmdlets The Flat OPC format is a different version of an Open XML document where the entire document is contained in a single XML file. Binary parts are stored as base-64 encoded ASCII. This is more convenient when transforming using XSLT and when storing in a database where you want to store documents as text only.
The New-Docx Cmdlet As part of your research process as an Open XML developer, if you have the need to quickly generate a new DOCX that contains some aspect or feature of Open XML, the New-Docx Cmdlet will help you out.
The Add-DocxText Cmdlet This Cmdlet enables you to append text to an existing Open XML WordprocessingML document (DOCX).

PowerTools for Open XML 2.2

Link Summary
Announcing the release of PowerTools for Open XML 2.2 Highlights the key enhancements of PowerTools for Open XML version 2.2.
Open-Xml-PowerTools Download the PowerTools for Open XML 2.2.1 source code from CodePlex. The new version includes a spreadsheet pivot table example.
Screen-cast: Building, installing, and running PowerTools for Open XML 2.2 Short screen-cast that shows how to build and install PowerTools 2.2. Shows running a cmdlet to verify that the installation worked properly.
PowerTools for Open XML 2.0 Cmdlets List of PowerTools for Open XML 2.2 cmdlets, with a short description of each one. Several of the cmdlets now have screen-casts recorded for them, so this is a good place to find out more about all of the cmdlets.
PowerTools 2.2 Code Design and Organization Shows technical overview of the new code for PowerTools 2.2 cmdlets and core code.
Screen-Cast: Functional Programming Utility Methods and Classes for Open XML Screen-cast that walks through the functions and classes in PtUtil.cs, which contains utility functionality that make it easier to work with Open XML using LINQ to XML.
Screen-Cast Creating Excel Pivot Tables Screen-cast shows how to use the PowerTools methods to create pivot tables for Excel.
Screen-Cast Open XML Code to Create Pivot Tables Screen-cast shows the Open XML code and elements needed to create a pivot table from scratch for Excel.

DocumentBuilder 2.0

DocumentBuilder 2.0 is a very important part of PowerTools for Open XML, and has its own resource center:
DocumentBuilder Resource Center

PowerTools for Open XML 1.1

Link Summary
Announcing the Release of PowerTools for Open XML V1.1 An introduction to PowerTools for Open XML 1.1.
Move/Insert/Delete Paragraphs in Word Processing Documents using the Open XML SDK Provides a detailed explanation of DocumentBuilder 1.1.
Accepting Revisions in Open XML WordprocessingML Documents Discusses the RevisionAccepter class.


PowerTools for Open XML 1.0

Link Summary
Automated Processing of Open XML Documents using PowerShell An introduction to PowerTools for Open XML 1.0.