Displaying an Open XML WordprocessingML Document in a Web Browser Control in Windows Forms

This is a fun little project that I needed to do to help out a customer. The customer needed to select a specific subset of paragraphs in a WordprocessingML document based on certain search criteria, and then display the subset in a form (in a Windows Forms application). As it turns out, it was pretty trivial to put together a proof-of-concept, so I shot this screen-cast that shows building this little application from scratch, using the PowerTools for Open XML core code. This little app doesn’t show it, but it is trivial to use DocumentBuilder to build a new document that contains just a subset of another document. Then you can display it using this method. Of course, this same approach would also work when displaying in a WPF application.

I’ve attached the code to this blog post.

Example – Download Code