RibbonX Resources

Today’s Guest Writer: Savraj Dhanjal

Savraj is a Program Manager on the Office User Experience team focused on user interface extensibility for Office developers.

Yesterday Jensen linked to the Ribbon developer center. It’s where we are bringing together all of our content on Ribbon Extensibility. I just wanted to highlight some of the key resources on the site.

Customizing the Ribbon For Developers, Part 1 takes you through the details of building a solution that customizes the Ribbon. If you’re new to the whole idea, which you probably are, start here.

Customizing the Ribbon For Developers, Part 2 includes a complete reference for every valid tag and attribute in a valid custom UI file. It also includes a FAQ with answers to common questions. For example, it tells you how to turn on RibbonX-related error messages. (Application Options > Advanced > General > Show add-in user interface errors.)

The site also includes an overview document and a half-hour screencast that details ribbon customization via the extensibility model.

The Beta 2 Schema will also be on the site shortly. For those of you that can’t wait for it, I’ve attached it here.

Finally, the one document I hope every solution author reads is the Style Guide for Solutions and Add-ins. It’ll give you a basic idea of how to think about your add-in or solution in the context of the new user interface. The style guide is really about the cliché “with great power comes great responsibility,” a quote that appears on blogs.msdn.com quite often.

Please take a look at the documents and let us know what you think. They’ll get updated between now and RTM for sure. Are there any particular samples that you would like to see?

Comments (22)

  1. Chris Smith says:

    Is there any way for non-techbeta users of beta 2 to file technical bug reports? I’m seeing a very specific issue running an Excel 2003 macro, where the "ActiveSheet" object doesn’t seem to change immediately after programmatically opening a CSV file, e.g. with:

    Workbooks.Open Filename:=this_file

    ActiveSheet.Name = sheetname

    ActiveSheet.Move Before:=DataBook.Sheets(LastTable): LastTable = ActiveSheet.Name

    I get run-time error 1004 (object-defined error) on the "Move" statement. I’ve tried it on multiple 2007 systems, and it fails in the same way – on the same systems running 2003 it works fine.

    I’m on the Vista techbeta but not Office… and I can’t see any feedback mechanism for Office 2007 Beta 2. I’d like to offer the entire macro and sample data file to make it very easy to repro the problem.

  2. Eugene Zolotko says:

    The articles and screencast are just great. I wrote my first ribbon extension and have a question. I’ve noticed that, when you change the main window width, built-in Office ribbon groups and buttons change their size in a smart way. But when I add my custom buttons to a ribbon, their width remains constant and the custom ribbon group never gets collapsed. So the question is how  I can get the same behavior for my custom controls as in native, buit-in Office controls?

  3. jensenh says:


    Try reporting the problem on the Office Discussion Forums (see the link in my post of yesterday.)

  4. Savraj says:

    Hi Eugene,

    Glad you like the resources.  So in Beta 2, you cannot make your custom groups scale like our built-in ones.  We realize this is a limitation in the RibbonX framework.

  5. Eugene Zolotko says:

    2 Savraj

    Thanks. So now I know that.

  6. wabik says:

    And why there was no ribbon in Outlook?

  7. Stefan KZVB says:

    Just tried some Ribbon Customization in VBA and still have problems with the following:

    – added some .rel and customui.xml to a .dotm-File. That worked fine and the onAction-Method gets also called when clicking the button. But after changing and saving the .dotm-template again from Word the .rel and customui.xml-files were gone :-((

    – tried to add a "getenabled"-callback to my sample button, but when the callback seems to be called word brings up an error message ("wrong number of parameters")- My Callback routine looks like this:

    Public Function NeuesDokEnabled(ByVal control As IRibbonControl) As Boolean

       If Minute(Now) Mod 2 = 1 Then

           NeuesDokEnabled = True


           NeuesDokEnabled = False

       End If

    End Function

    How do you do that correctly?

    – I wanted to add a custom image to the button using:


    I also added the bmp to the same folder as the customui.xml, but when word opened the file it told me it was corrupt.

    Please provide some detailed VBA-examples on that. Thank you!

  8. I am starting a blog on RibbonX and user customization at


    I hope to see a lot of people there!

  9. Joe Steinhardt says:

    Firstly, I’m loving your work. I’m really enjoying working on a new interface for my software and redesigning shiny new 32×32 32bit icons. (It’s a shame most of my clients still use Word 2000 but at least I’ll enjoy it on my home computer). I haven’t managed to get my images to appear on the buttons so I second Stefan’s request for VBA examples.

    I’ve found that although it’s possible to add groups to built in tabs, it’s not possible to add buttons to built in groups. Why is this? Is there a way round it? and will it be improved for the final version? You’ve advised us to place our custom controls where the user will find them, and in one example, i have a single button i want to add with the group GroupComments. It doesn’t deserve it’s own group.

    Many thanks and keep up the good work!!

  10. Joe Steinhardt says:

    Oh, and I also had Stephan’s problem of losing my .rels file and customUI.xml, which is a pain. Couldn’t it keep them there when it saves? It makes it alot of effort if i want to change the template, cos i have to copy the files in every time.

  11. Stefan KZVB says:

    Solved some of my problems described above:

    Problem was, that in VBA you have to make sub-routunes instead of functions. The parameters are described in: Customizing the Ribbon For Developers, Part 2.

    The picture for the button I think can’t be in the .dotm; you have to do a callback that returns the results of LoadPicture()

    For the lost .rels and customUI.xml, I did a workaround using a batch file that extracts the .dotm, copies the files in the extracted folder, and packs it again to a .dotm. But this issue REALLY should by solved!!!

    Joe, I’m glad that you 2nd this bug report…

  12. darkrats says:

    I sent you a question using the "Contact Jensen" link, only to get an automated response saying you can’t respond to email. Why then, do you even have that link on your site?

  13. E says:

    Nice site with lots of information. I am trying to add a simple custom icon to the Quick Access Toolbar.  Right now, as designed, my add-in appears in the "Add-Ins" tab, and my icon appears there.  All I’d like to do is add this icon to the Quick Access Toolbar, however, Word 2007 won’t allow me to do this. I’d like to eventually do this in code, but I can’t even do it manually?  Any suggestions?

  14. Delordson Kallon says:

    Will Office 2007 have facilities for mere mortals to record macros and link these to buttons on the ribbon? Everything I’ve read so far leads me to believe that extending the ribbon will be a developer only task.

  15. J-Walk says:

    Delordson, I’m pretty sure that what you describe is not possible. A user can record a macro, and then attach it to an icon on the QAT, but that’s as far as it goes.

    Even worse. If a user creates an Excel add-in that has a Sub procedure, there is absolutely no way to execute that macro. It can’t be added to the QAT (at least in Beta 2), and it doesn’t even appear in the Macros dialog box (you can, however, type the name manually). The user must either learn how to customize the ribbon, or create an out-of-date CommandBar.

    Clearly, a lot of work went into this new UI, but it still has LOTS of problems.

  16. Yesterday I talked about the command well which exposes all of the features in the Office 2007 programs….

  17. Tom Bombadil says:

    Useless info if only developers are allowed to customize the ribbon!!!!!!!!!!!!

  18. I missed this awhile back I think. Jensen Harris has a great post on customizing the Ribbon.

  19. Here is some useful information on the Office 2007 Ribbons and customizing them. http://msdn2.microsoft.com/en-us/office/aa905530.aspx

  20. Olá pessoal, tudo certo? Em ritmo de fim de ano e Tech-Ed Brasil 2007 , que começa amanhã, dia 05 de