C # Outlook 2007 - How to access attachment content directly from my upload?

I am trying to parse text file attachments (txt, doc, etc.). However, I apparently cannot get to the binary information itself. I can get the file name, and I can save the file in some temporary folder and open it from there, but it seems messy.

Is there a way to access the contents of the attachment without saving it, reading it and then deleting it, or am I just chasing my tail?

+3
source share
2 answers

Redemption will help you here in the SafeMailItem.Attachments collection there is an Attachment object that has the property "AsText" to check

http://www.dimastr.com/redemption/

76mel

+3

Microsoft -

   private void GetAttachmentContent(Attachments attachments)
    {
        foreach (Attachment attachment in attachments)
        {
            //microsoft schema to get the attachment content
            string AttachSchema = "http://schemas.microsoft.com/mapi/proptag/0x37010102";
            byte[] filebyte = (byte[])attachment.PropertyAccessor.GetProperty(AttachSchema);
        }
    }

: Microsoft.CSharp.dll

+3

Source: https://habr.com/ru/post/1569793/


All Articles