Open XML SDK: Character formatting in table cells with / without content

July 27, 2018

Once again, a question on Stack Overflow offered an intriguing problem that kept my brain busy for quite a while. When generating a table in a Word document cells containing no content would not retain the custom font size being assigned to each cell.


Web Add-ins: Using Office Open XML to extend the JavaScript APIs

August 26, 2015

In both the posts about Coercion types in Word Web Add-ins and reading built-in document properties a key point is using the Word Open XML file format in order to achieve something not available in the APIs. This approach works only in Word and it can be used for almost anything. Even the newer, extended […]


The Open XML Package Editor in VS 2012/2013

January 31, 2014

As more and more developers migrate to Visual Studio 2012 and/or Visual Studio 2013, we’re seeing requests in the Open XML SDK forum for a version of the Open XML Package Editor that works with these new versions of Visual Studio. (The Open XML Package Editor lets you view the structures and XML content in […]


Word Programmierung Handbuch (4th ed.) is here!

January 24, 2014

A few days late for my seminar, but it’s finally here! Despite Microsoft Press’s break with O’Reilly, leaving authors in the German market in limbo, the 4th edition of the Word Programmierung Handbuch has been printed, bound and is being distributed this week. Many thanks to the publisher for managing to accomodate all the new […]


Open XML SDK: Does the runtime version matter? YES!

January 8, 2014

There was a discussion in the Open XML SDK forum today that I found interesting. Certain namespaces for Office 2010 weren’t being recognized with a reference to the Open XML SDK version 2.0, even though they should have been. The references were being picked up just fine with a reference to the newer Open XML […]


Open XML SDK: Continuous section break in the middle of a paragraph

July 22, 2013

In my last post I described how to achieve a continuous section break in Word Open XML. In this post, I go into how to force the continuous section break in the middle of a paragraph.


Open XML SDK and Continuous Section breaks

July 21, 2013

There was a question the other day in the Open XML SDK forum about inserting Continuous section breaks. Inspecting a document.xml file, you’d think it would be as simple as adding a SectionType child element to a SectionProperties element associated with a paragraph’s properties, as can be seen in the following Word Open XML: <w:p><w:pPr><w:sectPr […]


Creating content from AutoText using the Open XML SDK

January 25, 2013

Since time immemorial, you’ve been able to save formatted and unformatted text for re-use in Word. Originally, this was called “AutoText”; in Office 2007 it was renamed “BuildingBlocks”. These can only be saved in Templates. Originally, they were saved by default to Normal.dot; since 2007 the default storage is an independet file, “Built-in Building Blocks.dotx”. […]


Bug: VB.NET Compatibility Setting using LINQ

January 23, 2013

In my last post I showed how to change the target version of Word for a document using the Open XML SDK in order to ensure that “[Compatibility Mode]” does not appear in the document’s title bar. The code sample was in C#. In this post I provide the code sample for VB.NET. Due to a […]


Open XML SDK, Word documents and Compatibility Mode

January 18, 2013

A relatively frequent request we see in the Open XML SDK forum is how to make the [Compatibility Mode] text in the Word title bar disappear. By default, the Open XML SDK will create a document compatible with Word 2007. When opened in a later version of Office, [Compatibility Mode] appears in the document title […]


ArgumentOutOfRange with WordProcessingDocument.Open

December 31, 2012

There is apparently a bug in the Open XML SDK 2.0 when trying to work with a document that contains a Ribbon extension using the namespace for Office 2010 <customUI xmlns=”http://schemas.microsoft.com/office/2009/07/customui“> If the document contains a customUI12 part, you get the error ArgumentOutOfRangeException when using WordProcessingDocument.Open. The problem appears to be fixed in Open XML […]


Merging Word documents using the Open XML SDK

November 15, 2012

A fairly common question in the world of Word Development is how to merge multiple documents into one. (See for example this discussion in the MSDN Open XML SDK forum.)


Word 2013 and text files as mail merge data sources

October 6, 2012

Once again, a forum question has prompted a topic for my blog. This time, it comes from the discussions about developing for Office 2013. For many years, a main focus of my work with Word has been related to importing and exporting data into and out of Word documents. The built-in functionality for this has […]


Word 2013 Comments and the Open XML SDK 2.5

September 30, 2012

Changes in the Word Open XML for comment’s functionality in Word 2013 were presented in my last post. This time, we’ll look at how these changes affect working with Comments using the Open XML SDK.


Working with form fields using the Open XML SDK

September 18, 2012

As described in earlier posts, Word 2007 and Word 2010 don’t properly save number formats to number-type form fields. So I decided to try my hand at my first serious manipulation of Office Open XML files. As I felt more comfortable with old-fashioned XML coding, the tool presented in that post only leveraged the Open […]


From Object Model to Open XML SDK Coding

September 17, 2012

No question: I’m object model-oriented. It didn’t take me long to recognize the advantages of object-oriented programming over Word Perfect keyboard macros and the user action emulation of WordBasic when VBA was introduced in the mid-90s!


Changing form field numbering formats using Open XML

September 14, 2012

Having overcome the obstacle mentioned in my last post, I continued work on a small tool to manage the number formatting of number form fields in Word documents. While becoming acquainted with the principles of Open XML I’ve always felt there are too few samples demonstrating how to work with the various Office applications. So […]


Open XML SDK can’t open an Office file

September 11, 2012

I thought it would be really cool if I could post code that would modify Word 2007 and Word 2010 documents to fix the numbering format problem described in my last post without needing to use Word 2013. I was stymied for three days by the error message:  “The specified package is invalid. The main […]