Warm tip: This article is reproduced from stackoverflow.com, please click
outlook outlook-web-addins

Outlook Add-in file reading from mail

发布于 2020-03-27 15:47:34

I am working on a Outlook add-in. I am not able to use the method item.getAttachmentsAsync in my plugin code to load and read the content of files. I am getting ERROR TypeError: item.getAttachmentsAsync is not a function in run time.

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

My requirement is explained below,

In the plugin we have a form and few fields are populated from mail body. And I need mail attachments to auto upload to Form.

Please suggest a better way to do that.

Questioner
VamsiThumati
Viewed
30
VamsiThumati 2020-02-08 00:05

using getAttachmentContentAsync I am able to get the file as a blob. but the problem is we need to call this method as soon after the mail opening. otherwise getting cors error