I am working in C# and I created an .msg file (more like reconstituted one) after having read it out of Exchange and made it downloadable from a website.
However even though all that works just fine, when I try to open the .msg file, I see this error: "Cannot start Microsoft Outlook. We can't open ------.msg It's possible the file is already open, or you don't have permission to open it."
The same error occurs in Chrome or in IE, regardless of whether Outlook is open. Further it occurs even though the read permissions are permitted on the file. I have Outlook 2016 and found this link but no real help:
https://www.add-in-express.com/forum/read.php?FID=5&TID=13956
Anyone else have this issue or thoughts on how to resolve?
if (attachment is FileAttachment)
and it's not. Then I checkif (attachment is ItemAttachment)
and it is. But this plain code here does not produce the correct-sized byte file:'itm.Load(EmailMessageSchema.MimeContent); var bytes = itm.Item.MimeContent.Content;' – John Lintonvar bytes = itm.Item.MimeContent.Content;
seems not to work in this instance so I'm unsure how to get an accurate byte[] array out of this particular attachment. To be clear I can save it but the size is way off. – John Linton