PowerTools for Open XML contains source code and guidance for accomplishing various common tasks using the Open XML SDK, such as:
- High-fidelity conversion of DOCX to HTML/CSS using HtmlConverter.cs
- Merging and splitting DOCX documents using DocumentBuilder.cs
- Merging and splitting PPTX presentations using PresentationBuilder.cs
- Accepting tracked revisions in DOCX documents using RevisionAccepter.cs
- Searching and replacing text in DOCX documents using TextReplacer.cs and OpenXmlRegex.cs
Combining the technologies of PowerShell and Open XML is a powerful and convenient way to do server-side document processing. The PowerTools for Open XML also contains sample source code and guidance for developers showing how to build PowerShell cmdlets that
can create and modify Open XML documents.
There are two important components of this project:
- C# code that uses the Open XML SDK to implement some core functionality, such as merging documents, converting DOCX to HTML/CSS, Merging PowerPoint presentations, and accepting tracked revisions. I sometimes refer to these as the PowerTools for Open
XML core modules.
- PowerShell Cmdlets (oriented towards Open XML developers) that make use of the core modules. These Cmdlets are aimed at making the job of an Open XML developer easier.
We are currently in the middle of a transition - with PowerTools 3.0 and onwards, the Cmdlets are written as advanced functions instead of in C#. There were about 44 Cmdlets in version 2.2. To date, in version 3.1.00, we have 15 Cmdlets (they are written using
advanced functions - PowerShell script). I will not be implementing all 44, as some of them were not useful. Further, I will be adding others that were not part of the original 44, but that are more useful to me in my day-to-day life as an Open XML developer.
If you find this project worthwhile, kindly rate the project or post a review, so that other developers or PowerShell users will know whether they want to try it out!
To install and build the PowerTools for Open XML Version 2.2 from source code, please see the readme in the release, or watch this
video that walks through the process of building and installing PowerTools for Open XML 2.2
If you have any issues with downloading, building, or using the PowerTools for Open XML, please feel free to contact Eric White: eric (at) ericwhite.com