问题
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.
回答1:
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";
来源:https://stackoverflow.com/questions/11881455/adding-pre-defined-office-ribbon-button-to-custom-ribbon-in-visual-ribbon-design