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

為{幸葍}努か 提交于 2019-12-12 19:43:31

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!