mspiess
Jun 29, 2022Brass Contributor
Status:
New
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 thi...
Rich-E
Aug 03, 2023Copper 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