How to create a dynamic submenu in contextmenu for outlook (VSTO)

浪子不回头ぞ 提交于 2019-12-04 22:13:21

The control type you're looking for is dynamicMenu

Here is the ribbon XML:

<dynamicMenu id="mycustomid" label="My custom label" getContent="GetMyCustomContent" />

And the code:

public string GetMyCustomContent(IRibbonControl control)
{
    return "<menu xmlns=\"http://schemas.microsoft.com/office/2009/07/customui\">"
        + "<button id=\"anotherid\" label=\"another label\" onAction=\"DoWhatever\"/>"
        + "</menu>";
}

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