Office 365 Mail App撰写模式 - 无法在Outlook桌面客户端中获取电子邮件正文内容

时间:2015-08-18 08:04:57

标签: javascript office365 office-addins

当我在Outlook桌面客户端中运行我的邮件应用程序时,我无法在撰写模式下获取正文内容。但是,当我在IE浏览器或Chrome或FF浏览器中访问我的应用程序时,我能够获得正文内容。任何人都可以帮我解决这个问题吗?请参阅随附的屏幕截图。

enter image description here

仅供参考,我使用的是1.1版本的Office.js,这是我的代码片段,用于阅读正文内容。

function getBody() {
    Office.cast.item.toMessageCompose(Office.context.mailbox.item).body.getAsync(function (result) {
        app.showNotification('The current body is', result.value)
    });

    //Office.context.mailbox.item.body.getAsync(Office.MailboxEnums.BodyType.Html, function (result) {
    //    app.showNotification('The current body is', result.value)
    //})
}

1 个答案:

答案 0 :(得分:1)

Body上的getAsync方法是在邮箱版本1.3中引入的,Outlook 2013不支持该方法.Outlook 2016支持它,目前处于预览状态。如果您想尝试一下,可以在此处下载预览:https://products.office.com/en-us/office-2016-preview

编辑:此外,您需要进行一次代码更改。 getAsync方法已更新,因此coercionType参数现在是必需的。 MSDN尚未通过此更改进行更新。因此,您需要将代码更改为:

Office.cast.item.toMessageCompose(Office.context.mailbox.item).body
  .getAsync("text", function (result) {
    app.showNotification('The current body is', result.value)
  });
相关问题