Archive for PowerTools

New Version of DocumentBuilder Available in PowerTools for Open XML

At long last, I have completed and posted a much requested and sorely needed update to DocumentBuilder. DocumentBuilder is code that is part of the PowerTools for Open XML project that handles issues of interrelated markup, enabling you to generate new documents from existing documents in a variety of ways. Many more details on


Ease your WordprocessingML Research using the Open XML Markup Simplifier Application

Sometimes when researching Open XML WordprocessingML markup, extraneous markup gets in the way of your research.  The extraneous markup makes it harder to see and understand the markup issues at hand.  The MarkupSimplifier class (which is part of the PowerTools for Open XML project) can help a lot, but as downloaded from CodePlex, it is only a class.  You need to write code to use the class, and if you want to use the markup simplifier as part of your research process, it is inconvenient.  I’ve written a small WinForm application that uses the MarkupSimplifier class, and makes the use of the simplifier class much more seamless in your research.

You can download the Markup Simplifier Application at  The code is attached to the blog post.

I’ve recorded a six minute video that shows the Markup Simplifier application in action:

This video shows how to build and run the Markup Simplifier application.


Getting Started with Open XML PowerTools Markup Simplifier

On, in one of the forums, there is a thread about how to clean Word proofing errors clutter out of an Open XML WordprocessingML document.  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.  The blog post, Enabling Better Transformations by Simplifying Open XML WordprocessingML Markup describes MarkupSimplifier in more detail.

Here is a small screen-cast that shows the use of MarkupSimplifier.  In the screen-cast, I use Open XML Package Editor Power Tool for Visual Studio 2010.

Walks through the process of downloading and compiling a sample for MarkupSimplifier.

Here is the listing of the small program that uses MarkupSimplifier

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenXmlPowerTools;
using DocumentFormat.OpenXml.Packaging;

class Program
    static void Main(string[] args)
        using (WordprocessingDocument doc =
            WordprocessingDocument.Open("Test.docx", true))
            SimplifyMarkupSettings settings = new SimplifyMarkupSettings
                RemoveComments = true,
                RemoveContentControls = true,
                RemoveEndAndFootNotes = true,
                RemoveFieldCodes = false,
                RemoveLastRenderedPageBreak = true,
                RemovePermissions = true,
                RemoveProof = true,
                RemoveRsidInfo = true,
                RemoveSmartTags = true,
                RemoveSoftHyphens = true,
                ReplaceTabsWithSpaces = true,
            MarkupSimplifier.SimplifyMarkup(doc, settings);

Comments (17)

« Previous Page « Previous Page Next entries »