如何使用移动加载项获取电子邮件正文 [英] How can I get the email body with a mobile Add-In

查看:62
本文介绍了如何使用移动加载项获取电子邮件正文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我的插件开发移动扩展点.

I'm working on a mobile extension point for my Add-In.

我想从任务窗格中获取电子邮件的 HTML 内容.

I want to get the HTML contents of an email, from a taskpane.

在桌面版本的加载项上,我从任务窗格 javascript 文件中调用 Office.context.mailbox.item.body.getAsync(),这工作正常.

On the desktop version of the Add-In, I call Office.context.mailbox.item.body.getAsync() from the taskpane javascript file, which works fine.

但是,在 Outlook 移动应用 for android 上,Office.context.mailbox.item.body 是一个空对象.Office.context.mailbox.item 似乎包含有关对话的所有上下文,但不包含实际电子邮件.

However, on the outlook mobile app for android, Office.context.mailbox.item.body is an empty object. Office.context.mailbox.item seems to have all the context about the conversation but not about the actual email.

如何从移动设备获取电子邮件的 HTML 正文?

How can I get the HTML body of the email from mobile?

推荐答案

要在 Outlook Android 上访问正文,您必须使用 Office.context.mailbox.item.body.getAsync().请在下面找到相同的片段:

For accessing body on Outlook Android, you will have to use Office.context.mailbox.item.body.getAsync(). Please find same snippet below:

Office.context.mailbox.item.body.getAsync("text",
 function (asyncResult) {
  if (asyncResult.status == "failed") {
   console.log("Action failed with error: " + asyncResult.error.message);
  } else {
   console.log(asyncResult.value);
  }
 }
);

这篇关于如何使用移动加载项获取电子邮件正文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆