And to further contradict my previous rants, it is possible to write a macro to load Word Document Parts. However, none of these contradictions hold comfortable solutions. First, you can see the XML file,
customUI.xml, in my
Normal.dotm template. All I had to do was to edit this file to customize the Word 2007 â€śFluentâ€ť Ribbon. This is what I did:
- Use the Custom UI Editor Tool to generate the proper OpenXML parts in the
Normal.dotmtemplate to get me started writing raw XML against the Word 2007 application. I could have done this by hand using the tool mentioned in step 2 but was too â€ślazy.â€ť
- Use the Open XML Package Editor in the VSTO 2008 Power Tools to write raw XML. Doing this in Visual Studio was easier on my eyes (larger, bolder fonts than the Custom UI Editor Tool) and I could use the
customUI.xsdschema (in 2007 Office System: XML Schema Reference) to make writing faster (Intellisense support). Also I found out the hard way that it is better to write this XML in a separate file in case Word panics and auto-magically deletes all of my hard work! Visual Studio is a great XML file editor.
- Use the 2007 Office System Document: Lists of Control IDs to wade through the sea of â€śFluentâ€ť fluxions. Utterly ridiculous but it helped.
Okay: and now the macro thing. This is the important call in the important line of code that makes loading Quick Parts (or Custom Quick Parts) automatable: Call
Application.NormalTemplate.BuildingBlockEntries.Add(). So whatâ€™s my problem? The problem is that a Range containing my custom XML does not get saved properly. Sometimes elements named â€śunknownâ€ť come out from the Quick Part Gallery. You donâ€™t understand what I am talking about? I can sympathize. It would take days upon days to explain to a Microsoft employeeâ€”even one on the Word 2007 teamâ€”what the hell I am talking aboutâ€¦ My guess is that this â€śedge caseâ€ť will be fixed by accident in a future release.
And, speaking of Microsoft employees, hereâ€™s a table of resources researched for this crap I am writing:
|â€śReuse and distribute parts of a documentâ€ť||This was first document that explained to me how to build a Building Block. â€śBuilding blocks are reusable pieces of content or other document parts that are stored in galleries.â€ť|
|â€śOffice 2007 â€śLegacyâ€™ Modeâ€ť||In case I want to admit that I canâ€™t handle change: â€śNo, itâ€™s not really a secret setting. Itâ€™s an add-in for Office 2007 that will finally give IT admins relief from that one user who resists change in all possible forms.â€ť|
|â€śCustomizing the Office 2007 Ribbonâ€ť||Somehow Word MVP, Bill Coan, wrote an article that misled me into thinking you could not customize the Word 2007 Ribbon without paying for it. Surely, thatâ€™s my faultâ€¦|
|â€śCustomizing the 2007 Office Fluent Ribbon for Developers (Part 1 of 3)â€ť||Frank Rice and Ken Getz: â€śLearn how to customize the 2007 Office Fluent user interface. Also learn how new features in Microsoft Visual Studio 2005 Tools for the 2007 Microsoft Office System support RAD development of Ribbon customizations. (40 printed pages)â€ť|
|â€śMapping Word 2007 Content Controls to Custom XML Using the XMLMapping Objectâ€ť||
This article really has nothing to do with the Ribbon but is related to â€ścustom XMLâ€ť: â€śOffice Word 2007 has no user interface (UI) to map controls to XML with one exceptionâ€”SharePoint and Built-in properties listed in the Quick Parts | Linked Properties menu.â€ť
My point? Developer tools are increasingly becoming more important (to me) for Word. It is not healthy to regard Microsoft Word as â€śthe peopleâ€™sâ€ť word processor.
|â€śXML: The Angle Bracket Taxâ€ť||A Jeff Atwood diversion: â€śXML is like democracy. Sometimes it even works.â€ť I commend Microsoft for attempting to XML-lize a word processor, but working with this is still not funâ€¦|
|â€śLinux.com :: The wide world of Linux word processorsâ€ť||This is a subtle admission that reading fonts comfortably in a Linux-based â€śfreeâ€ť word processor is not the greatest: â€śThe font rendering in TextMaker is a thing of beauty, and is noticeably superior to the other programs in this review.â€ť|
|â€śHow to: Create a Custom Building Block Galleryâ€ť||This is the article that showed that you can write a macro to load a Building Block.|
|â€śMicrosoft announces Open XML SDK roadmapâ€ť||When Microsoft writes about â€ś[a] content object model including additional classes and methods for simplifying developer work within partsâ€¦â€ť this responds directly to my