You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Outlook插件InsightMessage功能无法正常实现的技术求助

Outlook插件InsightMessage实现问题

我的Outlook插件使用ErrorMessage功能完全正常,但尝试实现InsightMessage及其关联动作时始终没有效果。目前能找到的有效资料只有微软官方文档和Stack Overflow上的相关问题。

我想要实现类似Viva的效果——显示包含操作链接的消息,但插件运行后没有任何反馈,打印result值仅显示存在错误,但无详细错误信息。

相关代码片段

Office.context.mailbox.item.notificationMessages.replaceAsync("messageKey", {
    type: Office.MailboxEnums.ItemNotificationMessageType.InsightMessage,
    message: email.Notification.Message,
    icon: 'TeamsAssistLogo64x64',
    actions: [{
        actionText: 'Open insight',
        actionType: Office.MailboxEnums.ActionType.ShowTaskPane,
        commandId: 'msgReadOpenPaneButton',
        contextData: JSON.stringify({ a: 'aValue', b: 'bValue' })
    }]
})

疑问

  • 插件如何识别另一个任务窗格插件?
  • TeamsAssistLogo64x64.png已在任务窗格清单中定义,是否配置正确?
  • 不确定msgReadOpenPaneButton是否正确,任务窗格清单里包含<Control xsi:type="Button" id="msgReadOpenPaneButton">

On-Send清单内容

<?xml version="1.0" encoding="utf-8"?>

<!-- Begin Basic Settings: Add-in metadata, used for all versions of Office unless override provided. -->

<!-- IMPORTANT! Id must be unique for your add-in, if you reuse this manifest ensure that you change this id to a new GUID. -->
<Id>20bbdabc-cb35-442f-9965-28a6099b25c4</Id>

<!--Version. Updates from the store only get triggered if there is a version change. -->
<Version>3.16.2.1</Version>
<ProviderName>TeamsAssist</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<!-- The display name of your add-in. Used on the store and various places of the Office UI such as the add-ins dialog. -->
<DisplayName DefaultValue="TeamsAssist Notifications" />
<Description DefaultValue="TeamsAssist OnSend Notifications" />
<IconUrl DefaultValue="https://teamsassistoutlookonsend.azurewebsites.net/Images/TeamsAssistLogo64x64.png" />
<HighResolutionIconUrl DefaultValue="https://teamsassistoutlookonsend.azurewebsites.net/Images/TeamsAssistLogo128x128.png" />

<SupportUrl DefaultValue="https://cloudassist.co/" />   

<!-- Domains that will be allowed when navigating. For example, if you use ShowTaskpane and then have an href link, navigation will only be allowed if the domain is on this list. -->
<AppDomains>
  <AppDomain>https://teamsassistoutlookserver.azurewebsites.net</AppDomain>
  <AppDomain>https://teamsassistoutlooktaskpane.azurewebsites.net</AppDomain>     
</AppDomains>
<!--End Basic Settings. -->

<Hosts>
  <Host Name="Mailbox" />
</Hosts>
<Requirements>
  <Sets>
    <Set Name="Mailbox" MinVersion="1.1" />
  </Sets>
</Requirements>
<FormSettings>
  <Form xsi:type="ItemRead">
    <DesktopSettings>
  <SourceLocation DefaultValue="https://teamsassistoutlookonsend.azurewebsites.net/index.html?serverURL=https://teamsassistoutlookserver.azurewebsites.net/" />
      <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>
<DisableEntityHighlighting>false</DisableEntityHighlighting>

<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
  <!-- On Send requires VersionOverridesV1_1 -->
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
  <Description resid="residAppDescription" />
    <Requirements>
      <bt:Sets DefaultMinVersion="1.3">
    <bt:Set Name="Mailbox" />
      </bt:Sets>
    </Requirements>
    <Hosts>
      <Host xsi:type="MailHost">
        <DesktopFormFactor>
          <!-- The functionfile and function name to call on message send.  -->
          <!-- In this particular case the function validateEmail will be called within the JavaScript code referenced in residUILessFunctionFileUrl. -->
          <FunctionFile resid="residUILessFunctionFileUrl" />
          <ExtensionPoint xsi:type="Events">
            <Event Type="ItemSend" FunctionExecution="asynchronous" FunctionName="validateEmail" />
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>
    </Hosts>
    <Resources>
      <bt:Urls>
        <!-- The JavaScript code is hosted on a secure and trusted web server. -->
        <bt:Url id="residUILessFunctionFileUrl" DefaultValue="https://teamsassistoutlookonsend.azurewebsites.net/index.html?serverURL=https://teamsassistoutlookserver.azurewebsites.net/"></bt:Url>
      </bt:Urls>
    </Resources>
  </VersionOverrides>
</VersionOverrides>

内容的提问来源于stack exchange,提问作者JohnD

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.26 01:57:07