Create a Word 2007 document from an InfoPath form using the OpenXML SDK 2.0

by S.Y.M. Wong-A-Ton

Learn how you can use the OpenXML SDK 2.0 to programmatically create a Word 2007 document from an InfoPath form and deal with complex data conversions such as those for rich text boxes and repeating tables.

The OpenXML SDK allows you to use classes to programmatically create Word 2007 documents. This means that you can also use this method to convert data stored in an InfoPath form into a DOCX file.

One of the drawbacks of using the InfoPath to Word XSLT conversion method is that you have to look for workarounds when trying to convert XHTML data from rich text fields in InfoPath. One way to overcome this limitation is by using classes and methods from the System.IO.Packaging namespace that come with the WindowsBase DLL.

The OpenXML SDK offers more flexibility when converting certain types of data from InfoPath (e.g. data from repeating tables or rich text fields) to Word. 

If you’re interested in getting started with the OpenXML SDK to programmatically create Word documents from InfoPath forms, see Using the Open XML Format SDK 2.0 to convert an InfoPath form into a DOCX file.

 Subscribe (RSS | Email)

Related Posts

Comments to this post were closed 30 days after it was published.

Copyright: This article may not be used on web sites (whether personal or otherwise), copied, disseminated, altered, printed, published, broadcasted, or reproduced in any way without an expressed written consent of S.Y.M. Wong-A-Ton. Usage of techniques demonstrated in this article may be used within any Microsoft InfoPath project. This article is provided without any warranties. Copyright for this article is non-transferrable and remains with the author, S.Y.M. Wong-A-Ton.

Working with InfoPath