6

在 office 365 Outlook 插件中,该方法在Outlook MacOffice.context.mailbox.item.body.getAsync()中不起作用。但它在safarichrome中运行良好。

office js 参考是“ https://appsforoffice.microsoft.com/lib/1/hosted/office.js

这是加载项读取应用程序的代码

     var _item = Office.context.mailbox.item;
     var body = _item.body;
        // Get the body asynchronous as text
        body.getAsync(Office.CoercionType.Text, function (asyncResult) {
            if (asyncResult.status !== Office.AsyncResultStatus.Succeeded) {
            }
            else {
                $('#subject').html(asyncResult.value.trim());
            }
        });         
4

2 回答 2

5

该功能是需求集 1.3 的一部分;Mac 插件仅支持要求集1.1 。

于 2016-04-08T13:37:23.723 回答
0

有同样的问题,但有一个解决方法。您可以使用需求集 1.1 中提供的 makeEwsRequestAsync() 方法来实现此目的。这需要您发出 SOAP 请求并解析响应数据以获取电子邮件正文。在 SOAP 请求中,使用:

    '        <t:AdditionalProperties>' +
    '            <t:FieldURI FieldURI="item:TextBody"/>' +
    '        </t:AdditionalProperties>' +

这将返回您可以解析的响应。

供参考: https ://dev.outlook.com/reference/add-ins/1.1/Office.context.mailbox.html#makeEwsRequestAsync

于 2016-05-12T21:25:04.463 回答