Welcome to MSDN Blogs Sign in | Join | Help

VSTO: My Favorite Feature - Ribbon Designer

 

One of my favorite features in the latest version of VSTO is the Ribbon Designer.  The Ribbon Designer makes it easy to customize the Ribbon in your Office applications.  In VSTO 2005 SE, you could add a Ribbon Item to your project and then add XML markup, along with code in callbacks to customize the Ribbon. In VSTO "Orcas" there is a designer that lets you customize the Ribbon in the same way you'd customize a Windows Form or a Task Pane -- you simply drag and drop controls from the toolbox onto the designer. You can then set properties of the controls, and write code in the event handler of the control.

Ribbon Designer in VSTO Beta 1

If you're using Visual Studio Code Name "Orcas" Beta 1, you can create an add-in (or document for Word/Excel) project, and then add a Ribbon (Visual Designer) item to your project.

When you add this item, a Ribbon designer will open, and you'll find that there are three controls available that you can drag from the Toolbox to the designer: a Button, Group and Tab

You can use existing Ribbon control images, by setting the ImageMSO property to the ID of the image. One way to get this ID is to look at the Customize tab of the Word Options dialog box, and hold your cursor over the button.  Another way is to download the entire list.

The name in parenthesis in the popup is the ID you need to enter.  You cannot re-use the functionality of the existing button using the designer, but you can either write code to recreate the functionality, or export the Ribbon customization to Ribbon XML and reuse the existing functionality. Note, however, that this export is one-way; you won't be able to import the Ribbon XML back into the designer, and you'll have to create callbacks rather than use the event handlers that the Ribbon designer provides.

If you want to use a custom image, you can import it to the project's resources and then select that image in the Image property.  The images don't appear in the designer, but will display after you run the project. To create the Click event handler for the button, you can double click the button and start writing code!

Let's take a look at this in a video . . .

View Video                                                                                    Download Video
                                                                                                      (Right-click link)

Update:  See a video that shows the Beta 2 Ribbon Designer features: http://blogs.msdn.com/kathleen/archive/2007/06/05/vsto-my-favorite-feature-even-better-in-beta-2.aspx

Ribbon Designer in upcoming VSTO CTP

In the upcoming CTP of VSTO, you'll find many more controls available in the toolbox, including the Button, CheckBox, ComboBox, Gallery, Label, Menu and more!  Be sure to check it out.

To see a list of other VSTO bloggers' favorite features, see the VSTO Developer Center.

--Kathleen

Published Wednesday, May 09, 2007 12:18 AM by kmcgrath

Comments

# re: VSTO: My Favorite Feature - Ribbon Designer

Sounds interesting. How does the generated XML look like?

Do we still have the option to add an Ribbon Item?

Wednesday, May 09, 2007 10:13 AM by XL-Dennis

# Designer generated RibbonX xml

Kathleen has posted about the new VSTO Ribbon designer being one of her favorite features. The Ribbon

Wednesday, May 09, 2007 11:49 AM by Paul Stubbs

# VSTO "Orcas" Ribbon Designer

Kathleen McGrath has a great blog post about her favorite feature in the upcoming "Orcas" release

Wednesday, May 09, 2007 12:17 PM by Paul Ballard's WebLog

# re: VSTO: My Favorite Feature - Ribbon Designer

Dennis -- yes you can still add the Ribbon (XML) item and add your markup manually. The Ribbon designer makes it easier with drag and drop capabilities, etc. Paul Stubbs just posted a blog entry about how to export the Ribbon XML at http://blogs.msdn.com/pstubbs/archive/2007/05/09/designer-generated-ribbonx-xml.aspx

Kathleen

Wednesday, May 09, 2007 1:29 PM by kmcgrath

# re: VSTO: My Favorite Feature - Ribbon Designer

Great - It's getting better and better!!

Kind regards,

Dennis

Wednesday, May 09, 2007 3:47 PM by XL-Dennis

# re: VSTO for Mere Mortals

I am going through chapter 2 and you show an excel spreadsheet as part of the design view.

I am unable to reproduce this.  I have written VSTO code, and it works for Excel, but have not been able to see the Excel file as part of the development environment.

Leon Rogson

Friday, May 11, 2007 11:25 AM by rogsonl

# re: VSTO: My Favorite Feature - Ribbon Designer

Hi Leon,

You need to have VSTO 2005 (not just VSTO 2005 SE) installed in order to see the Excel designer. If that's the case, and you're still not seeing the designer, please let me know.

--Kathleen

Monday, May 21, 2007 3:10 PM by kmcgrath

# VSTO: My Favorite Feature -- Even Better in Beta 2!

Recently, I posted an entry about my favorite VSTO feature : the Ribbon Designer. In Beta 2 of VSTO,

Tuesday, June 05, 2007 12:53 AM by Kathleen's Weblog

# re: VSTO: My Favorite Feature - Ribbon Designer

Can the ribbon designer in Orcas be used to add a tab on the ribbon of the normal.dotm template?

Tuesday, June 26, 2007 4:18 PM by DaLub

# Ribbon in VB6

Hi Kathleen,

I create successfully a sample ribbon in VB6.

I try to attach a image to an label. Following the Ribbon definition:

     "<tab id=""dotnetpro"" label=""C4B"">" & _

       "<group id=""Vorlagen"" label=""Unmanaged Ribbon"">" & _

         "<button id=""cmdVorlage"" label=""MSO8.dll und Ribbon"" onAction=""cmdVorlageOnAction"" getImage=""GetImage"" screentip=""Neues Dokument"" supertip=""Erzeugt ein neues Dokument auf Basis einer Vorlage.""/>" & _

       "</group>" & _

     "</tab>" & _

The following function is called:

Public Function GetImage(ByVal control As IRibbonControl) As IPictureDisp

   Dim picture As IPictureDisp

   Set picture = Nothing

   Set picture = LoadPicture(App.Path & "\MSN.ICO")

   Set GetImage = picture

End Function

The picture object is filled but I the image does not appears. Can you give me a small tip?

Thanks Christian

Tuesday, July 03, 2007 9:05 AM by Christian Havel

# re: VSTO: My Favorite Feature - Ribbon Designer

Re adding a ribbon tab to Normal.dot -- with VSTO, you can create an application level add-in and customize the ribbon for any document that is opened. It is global to all documents, so there is no need to add the ribbon to Normal.dot.

Re creating a Ribbon customization using VB6, I haven't tried that. I've asked folks on the VSTO team, and was told that your code looks okay, so you might try checking the following to troubleshoot: Does the .ico file work correctly if specified statically in the XML?  Does any other image file work with the code? Is the .ico file a transparent image? Is the path to the ico file correct?

--Kathleen

Tuesday, July 03, 2007 2:14 PM by kmcgrath

# re: VSTO: My Favorite Feature - Ribbon Designer

Hi Kathleen,

I just wanted to let you know that your blog is featured in RibbonX For Dummies by John Mueller -- the first book published on the subject of RibbonX programming in the VBA, C#, and Visual Basic environments. Please contact me if you would like a free review copy of the book.

Best regards,

Kyle Looper

Monday, August 27, 2007 4:30 PM by klooper

# Desenvolvimento de Ribbons para Office 2007.

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

Tuesday, December 04, 2007 7:47 AM by Arquitetura de Soluções

# Addins and Orcas...Part 2

Changing the default form of a folder One you have a replacement form region, this is the next thing

Monday, January 28, 2008 6:14 AM by Letz learn togather

# VSTO Addins and Orcas...Part 2

Changing the default form of a folder One you have a replacement form region, this is the next thing

Monday, January 28, 2008 6:28 AM by Noticias externas

# re: VSTO: My Favorite Feature - Ribbon Designer

Hi Kathleen,

I am very new to this blog and more for developing application with VSTO.

Is Visual Studio Code Name "Orcas" Beta 1 is mandatory  for ribbon designer application.

Can't we develop such applications in Visual Studio 2008 with VSTO 2005 SE?

Thanks,

Punit

Thursday, January 31, 2008 1:32 AM by punit.kumar@hcl.in

# re: VSTO: My Favorite Feature - Ribbon Designer

Hi Punit,

Visual Studio 2008 (Orcas) is not mandatory for customizing the Ribbon in Office 2007, but the new Ribbon designer makes it a lot easier!  You can definitely customize the ribbon usng VSTO 2005 SE.  See the following videos to get an idea about how to do so:  http://blogs.msdn.com/kathleen/archive/2007/02/05/vsto-for-mere-mortals-video-customizing-the-ribbon-with-vsto-2005-se.aspx and http://blogs.msdn.com/kathleen/archive/2007/02/10/vsto-for-mere-mortals-video-customizing-built-in-tabs-on-the-ribbon.aspx.

--Kathleen

Thursday, January 31, 2008 2:05 AM by kmcgrath

# re: VSTO: My Favorite Feature - Ribbon Designer

I have to develop a addin application for word 2007 that require dynamic updation of menus, labels on Ribbon UI.

How we can handle the events on menus and other UI's in Visual studio 2005 with VSTO 2005 SE?

Friday, February 01, 2008 4:00 AM by punit.kumar@hcl.in

# re: VSTO: My Favorite Feature - Ribbon Designer

Hi, I'm just curious whether or not these Ribbons will work for Project 2007?  If not, is there something that is similar in comparison?  I'll also be doing some adding of new functionality for Excel 2003... so maybe i use the same type of new item.  Is it a UserControl?  CustomControl?  I got your book but it seems to focus on Excel, Word, Powerpoints, etc. and not on Project.

Thanks!!

Lisa Seacat

cpup22@gmail.com

Thursday, February 14, 2008 10:08 PM by cpup22@gmail.com

# re: VSTO: My Favorite Feature - Ribbon Designer

Hi Lisa,

VSTO 2005 (on which the book is based) only support application development for Word, Excel, Outlook and InfoPath.  This latest version (VS 2008) supports a lot more Office applications.

Project 2007 doesn't have the new "Ribbon" UI, but instead uses the traditional menus and toolbar. Excel 2003 also has menus and toolbars (the Ribbon is new in some Office 2007 applications, such as Excel, Word, Outlook, PowerPoint)

See the following Help topics for information on how to customize them:

http://msdn2.microsoft.com/en-us/library/scff9c7c.aspx

http://msdn2.microsoft.com/en-us/library/0batekf4.aspx

There's also information about how to do this in the book (customizing a menu and toolbar is pretty much the same for all Office applications that have them).

I hope this helps!

Kathleen

Thursday, February 14, 2008 11:22 PM by kmcgrath

# re: VSTO: My Favorite Feature - Ribbon Designer

Hi.

Is there any way to remove the default tabs from the ribbon in Excel?

I need to open a "template" spreadsheet for my users and limit their editing abilities.

Thanks.

Thursday, February 28, 2008 9:37 AM by jpaull
Anonymous comments are disabled
 
Page view tracker