Creating Your Very Own Office 2007 Ribbon - No Programming Necessary!

by Nicholas Dille on 09/18/2009 | 3 Comments | 4,111 Views

The famous German IT magazine c't has recently published an article about creating your own and modifying existing ribbons in Office 2007. Not again, you may be thinking. But the article shows how a simple DLL helps without any knowledge of programming.

Building or modifying an Office 2007 ribbon usually involves programming a DLL and defining a ribbon inside. This is an awful hassle considering that its basically just moving some buttons around. (I am fully aware that its not that easy!)

Two German programmers have taken upon themselves the task of making life easier for you, ribbon creators. On their homepage, they offer the InstantRibbonChanger (beware, it's all in German). After registering the DLL, an INI containing XML-formatted data allows the following actions:

  • Adding new ribbons
  • Placing existing controls on new and existing ribbons
  • Hiding controls in existing ribbons
  • Customizing the presentation of controls
  • Defining your own keyboard shortcuts

For all these tasks, you will need to know the internal names of all the controls available in Office 2007. Fortunately, Microsoft lists then in several Excel files available here. In addition, an online book about programming Access describes all the attributes available to controls (sorry, German again).

In the following sections, I'd like to offer some examples to get you started. All examples apply to Word only.

General structure of the INI file

The INI file allows for separate sections for all Office products. I have tested this for Word, Excel and PowerPoint so far.

[Word]
<?xml version="1.0" encoding="iso-8859-1"?>
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon>
<tabs>
<!--
all your stuff goes here -->
</tabs>
</ribbon>
</customUI>

In the following examples, I will leave out the whole XML structure and only show the stuff inside the tabs tag.

Creating an addition ribbon

The following ribbon is called Favorites, is displayed before the first tab and accessible by the shortcut ALT-O.

<tab id="MeinTab" insertBeforeMso="TabHome" label="Favorites"
keytip="O">
<!-- more stuff goes here -->
</tab>

Placing existing controls on this tab

Include the styles gallery in your new tab.

<tab id="MyTab" insertBeforeMso="TabHome" label="Favorites"
keytip="O">
<group idMso="GroupStyles" />
</tab>

Creating a new group of controls

A group of controls is displayed with a box around them and usually contains controls of similar use.

<tab id="MyTab" insertBeforeMso="TabHome" label="Favorites"
keytip="O">
<group id="GroupDokumente" label="Document">
<control idMso="FileProperties" showLabel="false" keytip="E" />
<control idMso="FileSaveAs" showLabel="false" keytip="S" />
<control idMso="FileSaveAsPdfOrXps" showLabel="false" keytip="X"
/>
<control idMso="FileAddDigitalSignature" showLabel="false" keytip="P"
/>
<control idMso="Undo" showLabel="false" keytip="U" />
<control idMso="RedoOrRepeat" showLabel="false" keytip="D" />
</group>

Creating a new group of buttons

A group of controls are displayed closely together and considered a single unit when it comes to layouting.

<tab id="MyTab" insertBeforeMso="TabHome" label="Favorites"
keytip="O">
<group id="GruppeFormat" label="Format">
<buttonGroup id="ButtonsFontSize">
<control idMso="FontSizeIncrease" keytip="G" />
<control idMso="FontSizeDecrease" keytip="K" />
</buttonGroup>
</group>
</tab>


+++ Your opportunity +++ Use Profile Migrator 2, the new sepago product that makes migrating user personalities between different platforms a breeze.! Download your free version now!

3 responses for "Creating Your Very Own Office 2007 Ribbon - No Programming Necessary!"

Great tips! Ribbons can be

Great tips! Ribbons can be tricky to work with but you've written an easy to follow tutorial. The Office community on Facebook could really benefit from your expertise check it out at http://www.facebook.com/office

Cheers,
Andy
MSFT Office Outreach Team

"an INI containing

"an INI containing XML-formatted data"

Did I read that right or I'm just sleepy?

I searcehd a bunch of sites

I searcehd a bunch of sites and this was the best.

Add Comment

The content of this field is kept private and will not be shown publicly.
Captcha
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.

Microsoft Competence Blog

Application Infrastructure with Microsoft Technologies is an important focus at sepago. Our consultants have many years of experience in projects, are always open to new technologies and want a deep dive into it. The competence blog articles are providing this information.

RSS-FeedSubscribe articles

 

About the author

nicholas's picture
Nicholas Dille
Head of Technology and Innovation
Blogs about Centralized computing, virtualization and performance monitoring

All articles