Allow .msg file export through JS add-in API in Outlook-Desktop
I'd like to create an add-in which create a .msg file of an email and sends it to a remote server for archival purposes.
Outlook already can create .msg files through the "Save as..." dialog but this functionality is not exposed to the Office API.
I could access all relevant information through the API and create an .eml file for example (or use EWS/graph-API for that), but I'd prefer to leverage the existing outlook functionality.
I suggest a method "getMsgFileAsync( options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult<ArrayBuffer>) => void): void" on the "Office.context.mailbox.item" object.
As far as permissions go, "ItemRead" should suffice.
17 Comments
- Rich-ECopper Contributor
A native API would be fantastic! If you can't wait, as mentioned by OP, a workaround is to implement the EML format yourself (which is really just an IMF text file). It was a bit annoying, but doable (and totally worth it!)...
- item.getAllInternetHeadersAsync()
- extract MIME boundary from headers to separate messages below
- item.body.getAsync(Office.CoercionType.Html) & base64 encode
- item.body.getAsync(Office.CoercionType.Text) & base64 encode
- iterate through item.attachments & item.getAttachmentContentAsync()
- upload file
- Dan_RiemannCopper Contributor
Me to !
- Lafric655Copper Contributor
I need this feature as soon as possible !
- Jim_NeillCopper Contributor
This ability is critical to our workflow and with the new version of Outlook killing off VSTO and VBA add-in options there is no other way that I've found to accomplish what we've been doing for decades. Please consider adding this capability prior to release of the "New Outlook".
- sznorbert1107Copper Contributor
I am also interested in this topic.
It would be a great feature to have because it would make it so much easier to create an EML and send to a 3rd party server. We always struggle implementing this, because we must support this on every platform and there are lot of code challanges on different platforms.
Also it would be great to have this possibility on compose sidebar as well while composing an email.
Thanks!
- StbzzzCopper Contributor
Any chance on a comment on this one?
Is this possible or is it something that the Office API will never look to support?
Thanks!