我正在为Outlook开发一个JavaScript插件。
我在Outlook Web上进行了测试,因为它具有更好的调试器,并且在Outlook Web上运行良好,现在该插件已处于最后阶段。 现在,我在Outlook桌面上运行了插件,并收到了此错误。
未处理的承诺拒绝TypeError:对象不支持属性或方法'getAsync'
function getItemBody(){
console.log("Inside getItemBody().");
Office.context.mailbox.item.body.getAsync(
"text",
{ asyncContext: "This is passed to the callback" },
function callback(result) {
console.log(result);
console.log(result.asyncContext);
console.log(result.value);
var s = "Document_ID";
if (result.value.indexOf(s) !== -1){
console.log("Document id found.");
var substring = result.value.split(':').pop().split('.')[0];
document_uuid = substring;
localStorage.setItem("document_uuid", document_uuid);
}
});
}