Overview of the Office 2007 UI Customization Model
In my last post on customizing the Office 2007 UI, I spent a lot of time talking about all the customization approaches available to the user via the UI. However, I didn’t spend much time at all talking about RibbonX. Today’s post is going to introduce RibbonX conceptually.
Whether you are a developer or just a user who wants to create templates & documents with a customized Ribbon, there is no way around RibbonX. If you are a developer, then there is a good chance that you have never encountered any UI programming methodology like this one, except maybe if you did some Java UI programming (you might have encountered it then e.g. in the form of SwiXML). However, most Office and Windows developers are used to specifying a UI directly in code (or having a development environment like Visual Studio do it for them). This is how Office UI development worked until Office 2003 with the CommandBars model. The new RibbonX model however does not have an associated object model, nor is the UI specified in code. The following SmartArt gives an overview of the new Customization Model.

RibbonX Code
RibbonX code is XML code following an XML Schema provided by Microsoft. According to Wikipedia, “XML is a way of describing data and an XML file can contain the data too”. For the purposes of customizing the Office Ribbon UI, the XML describes everything. All the information about size, location, visibility, label, ID, etc that developers are accustomed to specifying in code are specified in the RibbonX XML format. Users, who up until now never had to worry about any of this, are going to have to learn some of it in order to be able to customize the new Ribbon UI.
If you are totally unfamiliar with XML or its relative HTML, take a look at this XML Tutorial.
Ribbon Application
The Ribbon Application of your choice (Access, Excel, Outlook, PowerPoint or Word) will read your RibbonX code and apply everything you specified in there to its own UI. Your RibbonX code is either provided via a document or template, or a COM add-in. Embedding the RibbonX code into an Office 2007 file format (OpenXML) document or template is the method of choice for users and VBA developers.
A big catch for developers with this new model is that there is only one opportunity to provide the RibbonX code. That means, an add-in can load Ribbon customizations once, normally at start-up. Modifying the Ribbon during the execution of the add-in is only possible in a limited way. That means, the UI a developer can specify is mostly static. When your add-in is unloaded, or the document/template with the RibbonX code closed, all the UI modifications you provided via RibbonX will be removed as well. This is contrary to the CommandBars model of previous Office versions, where developers had to ensure that all their UI customizations were properly removed.
Add-In
If you only want to provide a customized Ribbon for a document or template, then you are only going to be using features provided by Microsoft and this last section is of no relevance to you. If you however want to add your own functionality, e.g. because you are developing an add-in, and have that functionality accessible via the Ribbon, then you are going to have to implements “callbacks” in VBA or your COM add-in.
In the RibbonX code, you specify these callbacks. Callbacks are functions in your add-in code that Office calls under certain conditions. A callback shares many similarities with an event, but is not the same. For example, you can specify a callback that is called by Office when it wants to know whether a particular control is visible or not. Or, more event-like, when a user clicks a custom button you added to the Ribbon, the associated callback for this action is executed. You could also specify a callback to have Office get the label for a control.

December 29th, 2006 at 20:12
[…] Archival Notice: This post is no longer current and has been moved to the archive. Please read the new post replacing this one. Images and links in this post are not guaranteed to work. After highlighting in a previous post the lack of user customization, it is time to look at customization from a developer’s point of view. If you are interested in background reading on the topic or want a look ahead, read the UI blog on developer topics. […]
January 2nd, 2007 at 15:17
[…] If you haven’t read my conceptual overview of the Office 2007 UI Customization Model, now would be a very good time to do so. As explained in that overview, customizing the Office 2007 UI requires three distinct steps: […]