【发布时间】: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”。