Reading inline attachment id and name

S

Silas Peter

Hi,

Is there a way to identify inline attachments in Outlook 2003/2007. If I
would have to use redemtion objects can I cast an MAPI mailitem to redemption
mailitem in a background thread after the MAPI mailitem has been passed to
the thread.

Thanks,
Silas
 
K

Ken Slovak - [MVP - Outlook]

First of all, never access the Outlook or Redemption object models from a
background thread. Outlook and MAPI are designed to work on the main thread
and accessing those object models will hang or crash Outlook. If you must
use a background thread either synch it to the main thread context or
marshal it to the main thread before calling the object model, or get the
object data as strings or whatever and use those in the background thread.

If you have an item that has been saved and has an EntryID you can use
RDOSession.GetMessageFromID() with the EntryID to get an RDOMail item from
an Outlook item. The RDOMail item can be cast to a specific type such as
RDOTask if needed.

For Outlook 2007 you can use the PropertyAccessor object of the Attachment
object to find an embedded attachment. For Outlook 2003 you'd need to use
Redemption. You want to look for the presence of one or both of these
properties:

PR_ATTACH_CONTENT_ID 0x3712001E or "urn:schemas:mailheader:content-id" or
"http://schemas.microsoft.com/mapi/proptag/0x3712001E"

PR_ATTACH_CONTENT_LOCATION 0x3713001E or
"http://schemas.microsoft.com/mapi/proptag/0x3713001E"

If either of those properties is there it's an embedded attachment.
 
S

Silas Peterson

Hi Ken,
Thanks for the pointers. Can redemption be used for Outlook 2007 too?

Regards,
Silas.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top