Search code examples
javascriptoutlookmicrosoft-graph-apioffice365outlook-web-addins

Update Draft on-the-go in with outlook addin


I am working on a outlook add-in. I want to be able to update the draft with a data on the go (body of email converted to encrypted format.). The goal is to protect the data of user , so that the orignal data is not stored in draft as the person is writing in compose mode. I am using office.js(https://learn.microsoft.com/en-us/office/dev/add-ins/outlook/apis). But i am not able to update draft using it , also cannot access attachment in read mode. What could be a possible approch. Can i use Microsoft graph? or any suggestion how to solve the issue.


Solution

  • You should be able to update compose mails with any of the following apis:

    https://learn.microsoft.com/en-us/javascript/api/outlook/office.messagecompose?view=outlook-js-preview

    You can access attachments in Read Mode Via the Attachment APIs:

    https://learn.microsoft.com/en-us/javascript/api/outlook/office.messageread?view=outlook-js-preview#attachments

    https://learn.microsoft.com/en-us/javascript/api/outlook/office.messageread?view=outlook-js-preview#getAttachmentContentAsync_attachmentId__callback_