如何在Outlook的上下文菜单中创建动态子菜单(VSTO) [英] How to create a dynamic submenu in contextmenu for outlook (VSTO)

查看:248
本文介绍了如何在Outlook的上下文菜单中创建动态子菜单(VSTO)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个功能区xml,我想在其中添加与图片类似的内容.我尝试创建一个按钮并将菜单连接到该按钮,但是我没有得到箭头指示那里存在一个基础菜单.我根本不相信该按钮是要使用的正确元素.现在已经搜寻了几个小时,如果有人可以向我发送指示,我会很高兴.对我来说,在上下文菜单中添加元素没有问题,问题是链接到第一个元素的动态菜单.

I have a ribbon xml where I want to add something similar as in the picture. I tried create a button and connect the menu to the button but I never got the arrow indication there is a underlying menu. I have no faith at all in that button is the correct element to use. Been googling for hours now and would be happy if anyone can send me in some kind of direction. There is no problem for me to add the element in the context menu, the problem is the dynamic menu linked to the first element.

推荐答案

您要查找的控件类型是dynamicMenu

The control type you're looking for is dynamicMenu

这是功能区XML:

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

和代码:

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)
{
}

这篇关于如何在Outlook的上下文菜单中创建动态子菜单(VSTO)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆