0

I have an outlook .msg file that is treated as an attachment file. I want to calculate its size in byte using C#. I can calculate the size of other file formats other than .msg file using MsgReader. The problem is that the .msg file type in MsgReader is MsgReader.Outlook.Storage.Message and not MsgReader.Outlook.Storage.Attachment. So I cannot get its Data property. I think the solution is to convert Message type to Attachment type but I don't know how to do it.

alifcsai
  • 23
  • 5
  • Since Outlook messages usually are stored within PST or OST files, I assume that your msg file is somewhere on your hard disk... Wouldn't it be an option to just read the `FileInfo` of the msg file? Like described in this [SO Q/A](https://stackoverflow.com/a/20863065/13182522)? – Edgar.Bro May 17 '22 at 00:00
  • No. I cannot just read the FileInfo because I need to store the hash data of that .msg file into database – alifcsai May 17 '22 at 00:40
  • Is that an MSG file attachment or an embedded message attachment? There is a difference. The latter is not a file but an IStorage object. What is the value of the `Attachment.Type` property? – Dmitry Streblechenko May 17 '22 at 13:50

0 Answers0