Create a ribbon for Office 2007 in three easy steps
I'm preparing for a demo tomorrow on Office 2007 programability and I've been playing with the RTM version of VSTO SE (or Visual Studio Tools for Office Second Edition).
They've made huge progress forward on this since the beta code that I've been talking about over the last few months. One of the key areas that used to be kind of hard in the pre-release versions of VSTO was creating a Ribbon add in for Word.
Assuming you have VSTO SE installed (and if you dont, go and get it free from here), these are the steps to create a new ribbon for (for example) Word 2007.
- Create an Add in project (in this case a word add in project). File -> New Project, Expand Office, Expand 2007, then select "Word Add-In" and click OK.
- Right click on the "WordAddIn" project (or whatever you called it) and select Add -> New Item. In the dialog box that comes up select "Ribbon support" and click "Add" to add it to the project.
- Open the Ribbon.cs file that just got added and uncomment the code at the top of the file (except the first three lines that are actually comments.
Start word and you'll see a simple ribbon added to Word!. Now all you need to do is edit the Ribbon1.xml file to add your own buttons and functionality.
If you create something, let me know so I can talk about it with other customers!