Back in April of 2006, Brian Jones in “What about Word 2003’s XML format?” was right on the mark in his response to my comment/question about Word 2007’s programmatic support for the Word 2003 XML format. This was Brian’s response:
Great question. The range.xml property will still return the 2003 XML format. There is also a new property added called “wordOpenXML” (or something similar to that) that will return the serialized version of the Open XML format.
For C# programmers this means that:Application.Selection.get_XML()
will return the Word 2003 XML format in Word 2003 or 2007. The new 2007 format comes from here:Application.Selection.WordOpenXML
You may notice that the old 2003 deal is
get_XML() not “range.xml” (actually/ideally
Range.Xml). And this little casual oversight from Brian Jones is one of the reasons why my pathetic little attitude toward him was tinged with irriatation. He is coming from a case-insensitive VB.NET world view. Anyway, the great news is that my months of research into the 2003 format for CleanXHTML will live for at least a year more.
To leave Brian Jones in the cool, it helps to add this is not null in Word 2007:Application.CommandBars["Menu Bar"]
Whatever you add to this
CommandBar will appear in the Ribbon in the Add-Ins Tab. This is a wonderful way to be backwards compatible but learning how to customize the Ribbon is the best way to go as you can’t guarantee that the Add-Ins Tab will be visible by default (and your menu icons will probably look horrible anyway).
Martin Parry’s “Customising the Ribbon in 2007 Microsoft Office Applications” will help her but watch this older video with a caveat. The current Ribbon support for Office Word 2007 will not a add a Tab by default. Yes, once again, VSTO SE adds Ribbon customizations to the Add-Ins Tab by default. You will see this immediately in the XML definition of the Ribbon, the
idMso denotes the built-in name for the Add-Ins Tab. You will have to drop this attribute and then follow along with the video. It looks like adequate details (with screenshots) are available in “Customizing the 2007 Office Fluent Ribbon for Developers (Part 1 of 3).”