问题描述
尝试在电子邮件阅读页上的Outlook Web Addin(使用VS Code)中添加上下文菜单,但未显示任何菜单。不知道缺少什么,或者不确定是否要在manifest.xml中添加任何其他部分
使用的参考代码:https://docs.microsoft.com/en-us/office/dev/add-ins/outlook/contextual-outlook-add-ins
<ExtensionPoint xsi:type="DetectedEntity">
<Label resid="contextLabel" />
<!--If you opt to include RequestedHeight,it must be between 140px to 450px,inclusive.-->
<!--<RequestedHeight>360</RequestedHeight>-->
<SourceLocation resid="detectedEntityURL" />
<Rule xsi:type="RuleCollection" Mode="Or">
<Rule xsi:type="ItemIs" ItemType="Message" FormType="Read" />
<Rule xsi:type="ItemIs" ItemType="Appointment" FormType="Read" />
<Rule xsi:type="ItemHasKNownEntity" EntityType="PhoneNumber" Highlight="all" />
</Rule>
</ExtensionPoint>
解决方法
您在上下文外接程序和上下文菜单之间感到困惑。
Outlook加载项不支持每个文档的上下文菜单扩展点:https://docs.microsoft.com/en-us/office/dev/add-ins/reference/manifest/extensionpoint
从文档中-看到您在Outlook中没有ContextMenu,而在W,X,P,OneNote中拥有它。
Word,Excel,PowerPoint和OneNote加载项命令的扩展点。
- PrimaryCommandSurface-Office中的功能区。
- ContextMenu- 右键单击Office UI时出现的快捷菜单。
Outlook MessageReadCommandSurface的扩展点
- MessageComposeCommandSurface
- AppointmentOrganizerCommandSurface
- AppointmentAttendeeCommandSurface
- 模块(只能在DesktopFormFactor中使用。)
- MobileMessageReadCommandSurface
- MobileOnlineMeetingCommandSurface
- LaunchEvent
- 事件
- DetectedEntity
您在上面引用的清单是指向DetectedEntry
扩展点的,这意味着如果满足规则列表中的条件,则应获取上下文外接程序。不是菜单。