Outlook插件SupportsNoItemContext失效及加密邮件适配问题
Outlook插件在无邮件/加密邮件场景下灰显的问题探索
问题背景
我开发的Outlook插件挂载在MessageReadCommandSurface上,目前存在两个关键问题:
- 用户未打开任何邮件时,插件处于灰显禁用状态
- 用户打开加密/安全邮件(例如微软官方发送的邮件)时,插件同样灰显无法使用
这类场景出现频率越来越高,导致插件多数时间无法正常被用户调用。
此前我们使用COM插件,它可以在任意场景下正常启用,但COM插件安装流程繁琐,且不支持网页版Outlook,因此切换为Office插件。
已尝试的解决措施
- 按照无上下文插件规范修改Manifest,添加了
<SupportsNoItemContext>true</SupportsNoItemContext>配置,并指定Mailbox最低版本为1.13(官方说明该版本从2304内部版本16327.20248开始支持),但在Outlook 2019(版本2311,编译版本17029.20068,快速安装通道)中测试后,问题没有任何改善 - 尝试调整Manifest中的权限配置,无效果
- 完全复刻Viva Insights插件的Manifest结构,依旧无法解决问题,推测微软自有插件存在专属特殊机制
核心疑问
- 是否有办法让插件至少在加密邮件场景下可以正常打开?
- 是否存在其他扩展点,能够实现无邮件上下文或加密邮件场景下启用插件?
- 我不需要读取邮件内容,是否存在权限或配置上的遗漏点?
当前使用的Manifest代码
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0" xsi:type="MailApp"> <Id>df1a391f-7431-4c1c-a7dc-8599cb8bef2e</Id> <Version>1.0.0.1</Version> <ProviderName>Company</ProviderName> <DefaultLocale>en-US</DefaultLocale> <DisplayName DefaultValue="TestAddin"/> <Description DefaultValue="Addin description"/> <IconUrl DefaultValue="https://example.com/icon-64.png"/> <HighResolutionIconUrl DefaultValue="https://example.com/icon-128.png"/> <SupportUrl DefaultValue="https://example.com"/> <AppDomains> <AppDomain>https://example.com</AppDomain> <AppDomain>https://microsoftonline.com</AppDomain> <AppDomain>https://microsoft.com</AppDomain> <AppDomain>https://office.com</AppDomain> <AppDomain>https://login.microsoftonline.com</AppDomain> </AppDomains> <Hosts> <Host Name="Mailbox"/> </Hosts> <Requirements> <Sets> <Set Name="Mailbox" MinVersion="1.1"/> </Sets> </Requirements> <FormSettings> <Form xsi:type="ItemRead"> <DesktopSettings> <SourceLocation DefaultValue="https://example.com/"/> <RequestedHeight>250</RequestedHeight> </DesktopSettings> </Form> </FormSettings> <Permissions>ReadWriteItem</Permissions> <Rule xsi:type="RuleCollection" Mode="Or"> <Rule xsi:type="ItemIs" ItemType="Message" FormType="Read"/> <Rule xsi:type="ItemIs" ItemType="Message" FormType="Edit" /> <Rule xsi:type="ItemIs" ItemType="Appointment" FormType="Edit" /> <Rule xsi:type="ItemIs" ItemType="Appointment" FormType="Read" /> <Rule xsi:type="ItemHasKnownEntity" EntityType="MeetingSuggestion" /> <Rule xsi:type="ItemHasKnownEntity" EntityType="Address"/> </Rule> <DisableEntityHighlighting>false</DisableEntityHighlighting> <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0"> <Requirements> <bt:Sets DefaultMinVersion="1.3"> <bt:Set Name="Mailbox"/> </bt:Sets> </Requirements> <Hosts> <Host xsi:type="MailHost"> <DesktopFormFactor> <ExtensionPoint xsi:type="MessageReadCommandSurface"> <OfficeTab id="TabDefault"> <Group id="msgReadGroup"> <Label resid="GroupLabel"/> <Control xsi:type="Button" id="msgReadOpenPaneButton"> <Label resid="TaskpaneButton.Label"/> <Supertip> <Title resid="TaskpaneButton.Label"/> <Description resid="TaskpaneButton.Tooltip"/> </Supertip> <Icon> <bt:Image size="16" resid="Icon.16x16"/> <bt:Image size="32" resid="Icon.32x32"/> <bt:Image size="80" resid="Icon.80x80"/> </Icon> <Action xsi:type="ShowTaskpane"> <SourceLocation resid="Taskpane.Url"/> </Action> </Control> </Group> </OfficeTab> </ExtensionPoint> </DesktopFormFactor> </Host> </Hosts> <Resources> <bt:Images> <bt:Image id="Icon.16x16" DefaultValue="https://example.com/16.png"/> <bt:Image id="Icon.32x32" DefaultValue="https://example.com/32.png"/> <bt:Image id="Icon.80x80" DefaultValue="https://example.com/80.png"/> </bt:Images> <bt:Urls> <bt:Url id="Taskpane.Url" DefaultValue="https://example.com/"/> </bt:Urls> <bt:ShortStrings> <bt:String id="GroupLabel" DefaultValue="TestAddin"/> <bt:String id="TaskpaneButton.Label" DefaultValue="TestAddin"/> </bt:ShortStrings> <bt:LongStrings> <bt:String id="TaskpaneButton.Tooltip" DefaultValue="Opens a pane displaying TestAddin."/> </bt:LongStrings> </Resources> <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1"> <Requirements> <bt:Sets DefaultMinVersion="1.13"> <bt:Set Name="Mailbox"/> </bt:Sets> </Requirements> <Hosts> <Host xsi:type="MailHost"> <DesktopFormFactor> <ExtensionPoint xsi:type="MessageReadCommandSurface"> <OfficeTab id="TabDefault"> <Group id="msgReadGroup"> <Label resid="GroupLabel"/> <Control xsi:type="Button" id="msgReadOpenPaneButton"> <Label resid="TaskpaneButton.Label"/> <Supertip> <Title resid="TaskpaneButton.Label"/> <Description resid="TaskpaneButton.Tooltip"/> </Supertip> <Icon> <bt:Image size="16" resid="Icon.16x16"/> <bt:Image size="32" resid="Icon.32x32"/> <bt:Image size="80" resid="Icon.80x80"/> </Icon> <Action xsi:type="ShowTaskpane"> <SourceLocation resid="Taskpane.Url"/> <SupportsNoItemContext>true</SupportsNoItemContext> </Action> </Control> </Group> </OfficeTab> </ExtensionPoint> </DesktopFormFactor> </Host> </Hosts> <Resources> <bt:Images> <bt:Image id="Icon.16x16" DefaultValue="https://example.com/16.png"/> <bt:Image id="Icon.32x32" DefaultValue="https://example.com/32.png"/> <bt:Image id="Icon.80x80" DefaultValue="https://example.com/80.png"/> </bt:Images> <bt:Urls> <bt:Url id="Taskpane.Url" DefaultValue="https://example.com/"/> </bt:Urls> <bt:ShortStrings> <bt:String id="GroupLabel" DefaultValue="TestAddin"/> <bt:String id="TaskpaneButton.Label" DefaultValue="TestAddin"/> </bt:ShortStrings> <bt:LongStrings> <bt:String id="TaskpaneButton.Tooltip" DefaultValue="Opens a pane displaying TestAddin."/> </bt:LongStrings> </Resources> </VersionOverrides> </VersionOverrides> </OfficeApp>
内容的提问来源于stack exchange,提问作者veodko
相关产品推荐
相关产品推荐

