Develop Office Client Applications using Visual Studio
Office 2010 brings in many new features to the Ribbon and Backstage extensibility. In order to take advantage of those changes in VSTO addins, you will need to update your ribbon XML projects to use the new Office 2010 schema.
First, you will need to see if the schema is installed. To do this, look in “C:\Program Files\Microsoft Visual Studio 10.0\Xml\Schemas\1033” (you might need to modify this to point to your Visual Studio installation directory). If customui14.xsd is there, you can skip ahead to the next paragraph. Otherwise download the schema from here, and install it in the directory above. When you are done, double check to make sure that the custom14ui.xsd file is there.
Go to the Ribbon XML item that you want to use on Office 2010. For this blog post I am going to use a Word 2010 addin with a single Ribbon XML item, but the same code can work with any VSTO project with only minor modifications.
At the top Ribbon1.xml, there is a line
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="Ribbon_Load">
You will want to replace the URL with
If you look in the properties window for the XML document, the schema for the document should now point to the customui14.xsd that was installed. Now we can play around with it a bit. Under </ribbon> in Ribbon1.xml, add the following code:
<tab id="VSTOTab" label="VSTO Tab" insertAfterMso="TabInfo">
<group id="VSTOGroup" label="Hello From VSTO!">
label="Add More Cowbell"
We will also need to add the callback to Ribbon1.cs:
public void AddMoreCowbell(Office.IRibbonControl control)
And, of course, the integration in ThisAddin.cs
protected override Microsoft.Office.Core.IRibbonExtensibility CreateRibbonExtensibilityObject()
return new Ribbon1();
Run your add-in, and when you go to the backstage, you will find the backstage tab that we just added:
Now that you have the schemas set up, you can read up more on extending Backstage and new Ribbon features here:
Microsoft Office 2010 Technical Articles
- Customizing the Office 2010 Backstage View for Developers
- Ribbon Extensibility in Office 2010: Tab Activation and Auto-Scaling
Office 2010 Custom UI Schema (repost from above)