none
Outlook inline attachment RRS feed

  • General discussion

  • Hi,

    I am developing an Outlook Add-In. In which I have to read the inline attachement properties and save it  while sending email. It is posssible incase of Outlook mail format is 'HTML'. But incase of 'RichText' format, I am unable to get inline attachment properties and cann't save it.  Please provide any solution for this if anybody knows.

    Thanks in advance.

    Wednesday, February 8, 2012 7:30 AM

All replies

  • what do you mean by 'inline' attachment? All attachments, event added as embedded objects in RTF body, should be available in MailItem.Attachments collection. Can you check this?
    Wednesday, February 8, 2012 11:16 AM
  • Internally, embedded OLE attachments are stored inside the IStorage object (accessible through the PR_ATTACH_DATA_OBJ on the attachment). The format is specific to the application used to create the attachment.

    If using Redemption is an option, the next version will be able to extract the real attachment data for the bitmaps, Excel files, Word documents, PDFs, Power Point presenations, etc. Let me know if you want a beta version.


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

    Wednesday, February 8, 2012 1:52 PM
  • Hi,

    Thank you for your information. I can access the OLE attachment thorough the PR_ATTACH_DATA_OBJ.  But I am unable to save it to a file. My target is to save this OLE attachment to a file. Please give any solution to save this OLE attachment to a file.

    Thanks in advance.



    Friday, February 10, 2012 7:24 AM
  • The actual data is stored in one of the IStorage streams (posssibly with a prefix).

    You can look at the actual data in OutlookSpy - select the PR_ATTACH_DATA_OBJ property in OutlookSpy (IAttach window), right click, select IStorage interface.


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

    Friday, February 10, 2012 7:39 AM
  • Hi,

    Thank you for your valid information. Using Spy, I can understand the stream name is 'CONTENTS' where the attachment content is saved. I can read this 'CONTENTS'  stream of the attachment and save this stream to a file.

    My  another need is to create a Msg file with OLE attachment. please give the steps to do this.

    Thanks in advance.

    Friday, February 17, 2012 4:43 AM
  • You would need to recreate the structure of the IStorage attachment object.

    The format has never been documented, so you would pretty much need to make sure your IStorage is exactly the same as IStorage created by Outlook.


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

    Monday, February 20, 2012 6:51 PM