Search code examples
visual-studio-2010vstoribbonoffice-2010

Adding pre-defined Office Ribbon button to custom ribbon in Visual Ribbon Designer


I know how to add existing Office Ribbon items or groups to my custom ribbon using XML (using idMso tags) but how do I do this using the Visual Studio Ribbon (Visual Designer) technique?

Would really rather not have to build the entire thing using XML.


Solution

  • In Ribbon Designer, you can access the ControlId which points to the idMSO used in Ribbon UI XML. More specifically, ControlId.OfficeId represents the idMSO property that contains the specific Office control identifier.

    tools.Ribbon.RibbonTab tab = Globals.Factory.GetRibbonFactory().CreateRibbonTab();
    tab.ControlId.OfficeId = "TabNewMailMessage";