在Outlook中为Office.EventType.RecipientChanged注册处理程序的正确方法是什么?

布雷克头发

我试图构建一个Outlook Web加载项,该加载项根据电子邮件收件人更改电子邮件正文的内容。我目前有一个compose view命令,该命令可触发并成功报告该处理程序已注册,但是我从未看到该处理程序被调用。

Office.context.mailbox.item.addHandlerAsync(
  Office.EventType.RecipientsChanged,
  event => {
    console.log("event handled", event);
  },
  args => {
    console.log("handler registered status", args.status);
  }
);

调用此代码时,我会看到的日志handler registered status succeeded,但是在更改收件人时,我永远不会看到该event handled日志。我目前正在尝试使用网络版Outlook进行此操作,并且在我检查时报告支持API 1.7。

我的清单是:

<?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>a7aa0a09-480d-435e-bae7-35e2c35d89de</Id>
  <Version>1.0.0.0</Version>
  <ProviderName>POC</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue="On Recipient Change Handler"/>
  <Description DefaultValue="A proof of concept"/>
  <IconUrl DefaultValue="https://localhost:3000/assets/icon-32.png"/>
  <HighResolutionIconUrl DefaultValue="https://localhost:3000/assets/icon-80.png"/>
  <SupportUrl DefaultValue="https://localhost:3000/support.html" />
  <AppDomains>
    <AppDomain>contoso.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://localhost:3000/taskpane.html"/>
        <RequestedHeight>250</RequestedHeight>
      </DesktopSettings>
    </Form>
  </FormSettings>
  <Permissions>ReadWriteItem</Permissions>
  <Rule xsi:type="RuleCollection" Mode="Or">
    <Rule xsi:type="ItemIs" ItemType="Message" FormType="Read"/>
  </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>
          <FunctionFile resid="Commands.Url"/>
          <!-- Message Compose -->
          <ExtensionPoint xsi:type="MessageComposeCommandSurface">
            <OfficeTab id="TabDefault">
              <Group id="msgComposeCmdGroup">
                <Label resid="GroupLabel"/>
                <Control xsi:type="Button" id="msgComposeAddHandler">
                  <Label resid="FunctionButton.Label"/>
                  <Supertip>
                    <Title resid="FunctionButton.Title"/>
                    <Description resid="FunctionButton.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="ExecuteFunction">
                    <FunctionName>addHandler</FunctionName>
                  </Action>
                </Control>
              </Group>
            </OfficeTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>
    </Hosts>
    <Resources>
      <bt:Images>
        <bt:Image id="Icon.16x16" DefaultValue="https://localhost:3000/assets/icon-16.png"/>
        <bt:Image id="Icon.32x32" DefaultValue="https://localhost:3000/assets/icon-32.png"/>
        <bt:Image id="Icon.80x80" DefaultValue="https://localhost:3000/assets/icon-80.png"/>
      </bt:Images>
      <bt:Urls>
        <bt:Url id="Commands.Url" DefaultValue="https://localhost:3000/commands.html"/>
        <bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3000/taskpane.html"/>
      </bt:Urls>
      <bt:ShortStrings>
        <bt:String id="GroupLabel" DefaultValue="Handler"/>
        <bt:String id="FunctionButton.Label" DefaultValue="Set Handler"/>
        <bt:String id="FunctionButton.Title" DefaultValue="Set Handler"/>
      </bt:ShortStrings>
      <bt:LongStrings>
        <bt:String id="FunctionButton.Tooltip" DefaultValue="Set up a handler"/>
      </bt:LongStrings>
    </Resources>
  </VersionOverrides>
</OfficeApp>
Outlook加载项团队-MSFT

当前,仅Action xsi:type =“ ShowTaskpane”支持事件,Action xsi:type =“ ExecuteFunction”不支持事件。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Hibernate中的EventType.POST_UPDATE和EventType.POST_COMMIT_UPDATE有什么区别?

注册Office.EventType.ItemChanged时Outlook WebAddin抛出内部服务器错误

XmlPullParser“ eventType”指示什么?

我应该为 3 个 Handles.CircleHandleCap 中的每一个设置什么 EventType?

EventType:查看器请求的结果为503的Lambda Edge

如何在一个函数中调用多个 eventType?

为WebHistory通知注册处理程序时引发了意外的异常,这是怎么回事?

如何在Spring MVC 3.0中注册处理程序拦截器?

违反 PRIMARY KEY 不能在对象“dbo.EventType”中插入重复键。重复的键值为 (6)

为输入类型文件键入onChange处理程序的正确方法是什么?

使用Serilog保留EventType

Azure EventGrid主题与EventType

从React中的事件处理程序中删除动态DOM节点的正确方法是什么?

在vega-lite中实施自定义点击处理程序的正确方法是什么

从onClick事件处理程序将参数传递给React中的父组件的正确方法是什么

在 Go 中,在 http 处理程序中使用 pgx 上下文的正确方法是什么?

当在C#程序的调用堆栈中未找到任何处理程序时,正确的方法是什么

使用Kivy为同一事件添加多个处理程序的最佳/正确方法是什么?

Div宽度在Office Outlook Client中不正确

在 C++11 中处理毫秒的正确方法是什么

在NodeJS中处理发帖失败的正确方法是什么?

在Fortran中处理MPI通信器的正确方法是什么?

在 React 中处理表单提交的正确方法是什么?

在回调中处理异常的正确方法是什么?

在蛇案中处理数字的正确方法是什么?

在Spring Webflux中处理条件响应的正确方法是什么

在Django中处理用户触发事件的正确方法是什么?

在beego中处理表单提交的正确方法是什么?

在golang net / http中处理TLSNextProto的正确方法是什么?