【问题标题】:Office.EnhancedLocation failing with error 2006 "Invalid Format Error" in Outlook ClientOffice.EnhancedLocation 在 Outlook 客户端中因错误 2006“无效格式错误”而失败
【发布时间】:2021-03-26 13:10:01
【问题描述】:

OWA 仍然有效,但 Windows Outlook 客户端在尝试设置增强位置时失败。几天前工作正常。可能与 WebView2 的推出有关。

export const AddOutlookLocationAsync = (evt: Office.EnhancedLocation, location: Office.LocationIdentifier) => {
      const who: string = "AddOutlookLocationAsync";
      return new Promise<string>((resolve, reject) => {
        try {
          const locs: Office.LocationIdentifier[] = [];
          locs.push(location);
          DebugLog(who, "Add location " + JSON.stringify(location));
          evt.addAsync(locs, null, (result: Office.AsyncResult<void>) => {
            if (result.status === Office.AsyncResultStatus.Succeeded) {
              resolve();
            } else {
              reject();
            }
          });
        } catch (e) {
          DebugLog(who, "Catch " + JSON.stringify(e));
          reject(e);
        }
      });
    };

位置{id:“布莱克本鱼缸”,类型:“房间”}

id:“布莱克本鱼缸” 类型:“房间” 原型:对象

回应

结果

OSF.DDA.AsyncResult {值:未定义,状态:“失败”,错误: OSF.DDA.Error} 错误:OSF.DDA.Error 代码:2006 消息:“格式 指定的数据对象无效。" name: "无效格式错误" proto:对象状态:“失败”值:未定义 原型:对象

【问题讨论】:

  • 请分享您的 Outlook 和 Windows 内部版本号。此外,值得尝试 ScriptLab for Outlook 中的增强位置 API,以确认您是否能够重现该问题。您可以从 AppStore 安装 ScriptLab for Outlook。在 evt.addAsync 中不传入 null 也值得尝试您的 sn-p。 options 参数是可选的。
  • 它发生在多台 Windows 机器上(一台在英国加上我知道的我的机器)。 Outlook 是 V2101 Build 13801.20360、16.0.13801.20288 64 位。版本 Windows 10 Pro 版本 20H2 安装在 ‎11/‎28/‎2020 OS build 19042.867 Experience Windows Feature Experience Pack 120.2212.551.0
  • 我需要传入 Null,因为 TypeScript 会在没有该参数的情况下出错。类型 '(result: AsyncResult) => void' 与类型 'AsyncContextOptions' 没有共同的属性。
  • Microsoft Store 没有任何名为“Scriptlab”的东西。
  • 抱歉造成混乱,原评论有错别字,请尝试搜索“脚本实验室”(2个字)。单击 Outlook 功能区中的“获取加载项”按钮后,您应该能够搜索 Script Lab,作为参考,这里是在线 App Store 上加载项的链接:appsource.microsoft.com/en-us/product/office/… 这可能也值得尝试传入“{}”而不是“null”。

标签: office-js outlook-addin


【解决方案1】:

根据您提供的代码 sn-p,当位置类型为 Room 时,id 字段需要是电子邮件地址而不是常规字符串。 这是供参考的文档: https://docs.microsoft.com/en-us/javascript/api/outlook/office.locationidentifier?view=outlook-js-preview

【讨论】:

  • 好的。为什么它在 OWA 和 Mac Outlook 中有效?
猜你喜欢
  • 1970-01-01
  • 2020-10-25
  • 2014-08-09
  • 2017-12-26
  • 1970-01-01
  • 1970-01-01
  • 2020-07-25
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多