【发布时间】:2017-05-30 03:38:26
【问题描述】:
在 VSTO Outlook 加载项(适用于 Outlook 2009+)中将项目添加到上下文菜单(功能区)时,有没有办法为多个 idMso 使用相同的上下文菜单(即,我想添加选择单个或多个电子邮件时的相同项目)?我尝试了下面的 xml,但架构不喜欢我在多个地方重复使用相同的按钮 id。
<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
<contextMenus>
<contextMenu idMso="ContextMenuMailItem">
<button id="DoThis"
label="Label"
onAction="DoThis"
getVisible="GetVisible"/>
</contextMenu>
<contextMenu idMso="ContextMenuMultipleItems">
<button id="DoThis"
label="Label"
onAction="DoThis"
getVisible="GetVisible"/>
</contextMenu>
</contextMenus>
</customUI>
理想情况下,我想我想要这样的东西:
<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
<contextMenus>
<contextMenu idMso="ContextMenuMailItem,ContextMenuMultipleItems">
<button id="DoThis"
label="Label"
onAction="DoThis"
getVisible="GetVisible"/>
</contextMenu>
</contextMenus>
</customUI>
【问题讨论】:
标签: vsto outlook-addin ribbon