PowerTools for Open XML
Back to TOCJust VideosCondensed TOC
Example source code and guidance for creating, querying, and modifying Open XML documents, spreadsheets, and presentations.
- Automated Processing of Open XML Documents using PowerShell
- Inserting / Deleting / Moving Paragraphs in Open XML Wordprocessing Documents
- Move/Insert/Delete Paragraphs in Word Processing Documents using the Open XML SDK
- Interrelated Markup in Open XML Word Processing Documents
- Generating a Custom Letter using PowerTools for Open XML and PowerShell
- Generalized Approach to Open XML Markup References
- Comparison of altChunk to the DocumentBuilder Class
- PowerTools for Open XML
- Getting Started with PowerTools for Open XML Development
- Using DocumentBuilder with Content Controls for Document Assembly
- Transforming Open XML Word-Processing Documents to XHtml
- Transforming Open XML Word-Processing Documents to XHtml (Post #2)
- Transforming Open XML Word-Processing Documents to Html (Post #3)
- Open XML WordprocessingML Style Inheritance (Post #4)
- Comparison of Html/CSS Tables to WordprocessingML Tables (Post #5)
- Assembling Paragraph and Run Properties for Cells in an Open XML WordprocessingML Table
- Implementing ‘Inheritance’ in XML
- Working with Numbering in Open XML WordprocessingML
- Accepting Revisions in Open XML WordprocessingML Documents
- How to Control Sections when using DocumentBuilder
- Simplifying Open XML WordprocessingML Queries by First Accepting Revisions
- Writing Entity References using LINQ to XML
- Enabling Better Transformations by Simplifying Open XML WordprocessingML Markup
- Retrieving the Default Style Name of an Open XML WordprocessingML Document
- ListItemRetriever: Accurately Retrieving Text of a Open XML WordprocessingML Paragraph
- Transforming WordprocessingML to Simpler XML for Easier Processing
- Transforming Open XML WordprocessingML to XHTML Using the Open XML SDK 2.0
- Mastering Text in Open XML WordprocessingML Documents
- Getting Started with Open XML PowerTools Markup Simplifier
- Open XML Markup Simplifier Application makes it easier to research WordprocessingML
- Introduction to DocumentBuilder 2.0 – Screen-Cast 1 of 3
- Introduction to DocumentBuilder 2.0 – Screen-Cast 2 of 3
- Introduction to DocumentBuilder 2.0 – Screen-Cast 3 of 3
- Introducing TextReplacer: A New Class for PowerTools for Open XML
- Notes about the Microsoft Public License
- Short and Sweet Intro to DocumentBuilder 2.0
- Advanced use of DocumentBuilder 2.0
- Exploring the Set-OpenXmlString CMDLET in PowerTools for Open XML 2.2
- Merge Comments from Multiple OpenXML WordprocessingML Documents into a Single Document
- Split-OpenXmlDocument cmdlet in PowerTools for Open XML
- Screen-Cast: Functional Programming Utility Methods and Classes for Open XML
- Open XML Specific Utility Methods and Classes in PowerTools for Open XML
Processing Open XML documents using PowerShell is a powerful approach for creating, modifying, and transforming Open XML documents. The PowerTools for Open XML are examples and guidance that show how to do this. They consist of PowerShell cmdlets, and a number of example scripts that demonstrate the use of the cmdlets. Examples include automated word processing document and spreadsheet generation, and preparing documents for distribution external to a company, including removing comments, accepting revisions, applying a uniform theme to them, and applying a watermark to them. (Article)
If you are making a tool to manipulate paragraphs in Open XML Documents, then this post lists some of the constraints that you must pay attention to. (Article)
Move/Insert/Delete Paragraphs in Word Processing Documents using the Open XML SDK (Article)
Interrelated Markup in Open XML Word Processing Documents (Article)
Lawrence Hodson has written a cool article (with accompanying example PowerShell scripts) published on OpenXmlDeveloper.org that uses PowerTools for Open XML v1.1 to generate a letter. His scenario is interesting – he generates a service level agreement (SLA) report based on information that he retrieves using PowerShell cmdlets. His example includes assembling the document from multiple source documents and making use of content controls that are bound to custom XML. (Article)
An explanation of the issues around interrelated markup that DocumentBuilder (a class in PowerTools for Open XML) solves. (Article)
This post compares and contrasts two approaches to assemble multiple Open XML word processing documents into a single document (Article)
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 are sample source code and guidance for developers showing how to build PowerShell cmdlets that can create and modify Open XML documents. Also included are a number of examples of PowerShell scripts that use the cmdlets. (Article)
There are a number of resources and guidelines that PowerTools for Open XML developers need in order to write PowerShell cmdlets for processing Open XML documents. This post presents a few tips for getting started developing PowerTools cmdlets. (Article)
DocumentBuilder is an example class that’s part of the PowerTools for Open XML project that enables you to assemble new documents from existing documents. DocumentBuilder fixes up interrelated markup when assembling a new document from existing documents. This post shows how to use DocumentBuilder in concert with content controls to control the document assembly. (Article)
First post in a series on transforming Open XML WordprocessingML markup to XHtml (Article)
Second post in a series on transforming Open XML WordprocessingML markup to XHtml (Article)
Third post in a series on transforming Open XML WordprocessingML markup to XHtml (Article)
Explores and explains style inheritance in Open XML WordprocessingML (Article)
Compares HTML tables that use CSS styling to tables in Open XML WordprocessingML. Explains significant semantic differences. If you are familiar with HTML tables, this is an easy way to learn about WordprocessingML tables. (Article)
When you want to render a paragraph and its runs inside of a cell, you need to assemble the paragraph and run properties from a number of places. This post details how we assemble styling information from table styles, the formatting directly applied to tables, paragraphs, and runs, and the global default paragraph and run properties.
(Article)
(Article)
Some XML vocabularies implement a powerful XML pattern that is analogous to inheritance in programming language type systems. Open XML WordprocessingML has these semantics around styles. When you define a new style, you can base this style on another style, and if the new style doesn’t explicitly define some aspect of the style, the new style ‘inherits’ this aspect from its base style. This post presents some code that uses one approach for implementing inheritance semantics. (Article)
When implementing a conversion of Open XML word processing documents to HTML, one of the interesting issues is accurately converting numbered and bulleted lists. You must pay special attention to them, because they impact the text that the document contains, but that text isn’t directly in the markup. If you are accurately extracting the text of the document, you must process some elements and attributes to assemble the correct text. (Article)
Revision tracking markup in Open XML word-processing documents is one of the more complex areas of the standard. If you first accept tracked revisions, it makes subsequent processing of text in word-processing documents much simpler. As an example, in my current project of transforming Open XML word-processing documents to XHtml, before doing the conversion, I accept tracked revisions in an in-memory WordprocessingDocument object. (Article)
When using DocumentBuilder, sometimes you want to control is how sections are copied to the document you are building. Sections carry a fair amount of formatting information, including the layout of the page, and the headers and footers that will be used for the section. (Article)
Simplifying Open XML WordprocessingML Queries by First Accepting Revisions (Article)
As delivered, it is difficult to write entities using LINQ to XML. This post presents a small hack that enables you to serialize XML entities. (Article)
When transforming Open XML markup to another XML vocabulary (such as XHtml), you can sometimes simplify the transform by first transforming the original document to a new, valid WordprocessingML document that contains much simpler markup, and therefore is easier to process. This blog post describes a utility class, MarkupSimplifier, which is part of the PowerTools for Open XML project. (Article)
Whenever you write some Open XML SDK code that processes paragraphs based on style name, you need to retrieve the default style name for a document. (Article)
Accurately Retrieving Text of a Open XML WordprocessingML Paragraph. (This is one in a series of posts on transforming Open XML WordprocessingML to XHtml.) (Article)
Transforming WordprocessingML to Simpler XML for Easier Processing (Article)
Transforming Open XML WordprocessingML to XHTML Using the Open XML SDK 2.0 (Article)
Understand how to reliably retrieve text from Open XML WordprocessingML documents. (Article)
In PowerTools, in the HtmlConverter project, there is a class called MarkupSimplifier, which can remove proofing errors. In addition, it can simplify WordprocessingML markup in a variety of ways, including removal of comments, content controls, and etc.
Here is a small screen-cast that shows the use of MarkupSimplifier. This screen-cast uses Open XML Package Editor Power Tool for Visual Studio 2010. (Article,Video)
Here is a small screen-cast that shows the use of MarkupSimplifier. This screen-cast uses Open XML Package Editor Power Tool for Visual Studio 2010. (Article,Video)
Sometimes when researching and examining Open XML WordprocessingML markup, extraneous markup that is not relevant to the issue at hand gets in the way of seeing what is going on. If you are researching markup by creating documents, altering documents, and then comparing the two documents, as detailed in How to Solve Open XML Developer Problems, your research process is made significantly easier by simplifying the markup before comparing. (Video)
This post contains the first of three screen-casts that introduces DocumentBuilder 2.0, talks about interrelated markup, and explores how DocumentBuilder solves developer issues with regards to interrelated markup. While this screen-cast is a bit long (20 minutes), it will be important for developers using DocumentBuilder who want to know how DocumentBuilder works. (Video)
This screen-cast builds on the previous screen-cast where I walk through the process of transferring comments from multiple source documents into a destination document. In this screen-cast, I insert images into the comments. This introduces some complexity – the comments part has a relationship to an image part. (Video)
This screen-cast builds on the previous two screen-casts where I walk through the process of transferring comments from multiple source documents into a destination document. In this final screen-cast in the series, I walk through some of the code in DocumentBuilder 2.0 – I explain how the code is data-driven to make it more robust, and discuss the structure of the code and how DocumentBuilder 2.0 works. (Video)
This code to search-and-replace in an Open XML WordprocessingML document uses LINQ to XML to implement a functional transform. (Video)
The blog post presents some links around the Microsoft Public License (Ms-PL). PowerTools for Open XML are licensed under the Microsoft Public License. (Article)
This is a short screen-cast that explains what DocumentBuilder 2.0 is all about, in less than seven minutes. (Video)
The default approach to working with DocumentBuilder 2.0 enables you to take bits and pieces of multiple documents and assemble them together into a new document. However, there is an interesting scenario that this approach does not handle. You may want to import a document into a cell in a table, into a text box, or into a content control. You can do this with DocumentBuilder 2.0. This video shows how. (Video)
The Set-OpenXmlString cmdlet enables interesting functionality – you can do a search-and-replace of content without automating Word, and you can search-and-replace in many documents at once. The Set-OpenXmlString can search-and-replace in both WordprocessingML documents and PresentationML documents. (Video)
Introduces code that shows how to merge comments from multiple WordprocessingML documents into a single document. (Video)
In document processing parlance, shredding a document is the process of dividing a source document according to certain rules, and creating a number of documents from the source document. This is useful, for instance, when you have a huge document, and you want to divide it into multiple documents to hand off to different authors or editors. Then, after all edits have been completed, you can merge the various parts back into a complete document. (Video)
In the process of developing the PowerTools for Open XML, over the years, I have developed some needed core functionality and utility methods, particularly for writing LINQ to XML code that queries and transforms Open XML documents. (Video)
Screen-cast that introduces a number of OpenXML specific utility methods and classes in PowerTools for Open XML. These classes and methods are in the PtOpenXmlUtil.cs module. (Video)