none
how to get the attachments stream RRS feed

  • Question

  • Currently I'm using something like this 
    byte [] content = mail.Attachments[k].PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x37010102");
    and then I'm converting the content to a base64 string . But I've heard on another forum that in outlook 2007 I can use this property only for attachments with size smaller or equal to 8 kb so I need another method for getting the stream content. 
    Tuesday, May 20, 2014 8:54 AM

Answers

  • Hello,

    The Outlook object model doesn't provide any property or method for this.

    Extended MAPI provides the OpenProperty method for getting large property values or the PT_Object type.

    • Marked as answer by intenesi Wednesday, May 21, 2014 6:42 AM
    Tuesday, May 20, 2014 12:24 PM
  • In Extended MAPI (C++ or Delphi), use IAttach::OpenProperty(PR_ATTACH_DATA_BIN, IID_IStream, ...).

    If using Redemption is an option, you can use RDOAttachment.AsStream property.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    • Marked as answer by intenesi Wednesday, May 21, 2014 6:42 AM
    Tuesday, May 20, 2014 5:09 PM

All replies

  • Hello,

    The Outlook object model doesn't provide any property or method for this.

    Extended MAPI provides the OpenProperty method for getting large property values or the PT_Object type.

    • Marked as answer by intenesi Wednesday, May 21, 2014 6:42 AM
    Tuesday, May 20, 2014 12:24 PM
  • In Extended MAPI (C++ or Delphi), use IAttach::OpenProperty(PR_ATTACH_DATA_BIN, IID_IStream, ...).

    If using Redemption is an option, you can use RDOAttachment.AsStream property.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    • Marked as answer by intenesi Wednesday, May 21, 2014 6:42 AM
    Tuesday, May 20, 2014 5:09 PM