javascriptoffice-addinsoutlook-web-addins

Outlook Web Add-In: Display reply form with current mail item's attachments


When you click "Reply" in outlook, it doesn't preserve the attachments, so I'm working on a web add-in "Reply With Attachments" - Upon clicking my add-in button, a new reply window should be open, and the attachments of the selected mail item should be attached to that reply window. According to Microsoft docs, this is how you display a reply form with attachments:

Office.context.mailbox.item.displayReplyForm(
{
    'htmlBody' : 'hi',
    'attachments' :
    [
        {
            'type' : Office.MailboxEnums.AttachmentType.File,
            'name' : 'squirrel.png',
            'url' : 'http://i.imgur.com/sRgTlGR.jpg'
        }
    ]
});

but is it possible to add attachments to the reply form in a way other than specifying the URL? I already have the attachments of the current email in code:

let attachments = Office.context.mailbox.item.attachments;

One approach I thought of is to upload the attachments to file storage system (Egnyte), and then specify each file's URL in the 'url' property of an attachment, but then I would have to temporarily make those files public, and delete them after adding them to reply form. But I don't want to make sensitive files public, even temporarily. And also this approach seems like overkill for something so simple and straightforward. Any ideas?


Solution

  • Currently the feature: add attachments of current item via displayReplyForm API without a temporary save, is not a part of the product. We track Outlook add-in feature requests on our Tech Community Page http://aka.ms/M365dev-suggestions. Please submit your request there and choose the appropriate label(s). Feature requests on Tech Community are considered, when we go through our planning process.