温馨提示:本文翻译自stackoverflow.com,查看原文请点击:其他 - Outlook Add-in file reading from mail
outlook outlook-web-addins

其他 - 从邮件读取Outlook加载项文件

发布于 2020-03-27 16:20:02

我正在使用Outlook加载项。我无法在插件代码中使用方法item.getAttachmentsAsync加载和读取文件的内容。我收到错误TypeError:item.getAttachmentsAsync在运行时不是一个函数。

var item = Office.context.mailbox.item;
var options = {asyncContext: {currentItem: item}};
item.getAttachmentsAsync(options, this.callback);

我的要求在下面说明,

在插件中,我们有一个表单,并且邮件正文中填充了几个字段。我需要邮件附件才能自动上传到表单。

请提出一种更好的方法。

查看更多

查看更多

提问者
VamsiThumati
被浏览
103
VamsiThumati 2020-02-08 00:05

使用getAttachmentContentAsync我可以将文件作为Blob获取。但是问题是我们需要在邮件打开后尽快调用此方法。否则会出现cors错误