Differentiate between real attachment & embedded image inside mail

  • Thread starter Thread starter Kctan80
  • Start date Start date
K

Kctan80

Greeting all,
How can i differentiate between embedded image inside body of email & image
that attached inside mail itself. When i looking into MailItem.Attachments
object, it contains these 2 images with no indication whether this image is
belong as embedded image or attachment.
Please help. Thanks.
 
Ok - what if you just want to access the property of the attachment that lets
you know what the CID is for an embedded image attachment?

Do this just using VSTO objects and MAPI properties found within the
MailItem.Attachments[x] item, no third party library...


:.
 
VSTO has nothing to do with it.

Unless you are using Outlook 2007 where you can use the new PropertyAccessor
object of the Attachment then you can't do what you want using only the
Outlook object model. If you are using Outlook 2007 you could use something
like this to get PR_ATTACH_CONTENT_ID, assuming that "oAtt" is an attachment
object:

oAtt.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x3712001E")

Note that what looks like an URL is actually the property tag for
PR_ATTACH_CONTENT_ID using DASL syntax and is passed as a string.

You couldn't use CDO 1.21 for that, it's not supported for any managed code.
You couldn't use Extended MAPI, that's also not supported for managed code
and is only programmed using C++ or Delphi.

So those are your choices, use Outlook 2007 or Redemption or forget it.
 
I had the same problem and solved it by getting a list of all attachments by name then seeing if they were in the HTML text of the Email message. If they were then they are embedded logos, signatures etc. If not they are a real attachment.

Seems to work OK
Gary
Greeting all,
How can i differentiate between embedded image inside body of email & image
that attached inside mail itself. When i looking into MailItem.Attachments
object, it contains these 2 images with no indication whether this image is
belong as embedded image or attachment.
Please help. Thanks.
On Wednesday, September 17, 2008 12:40 AM RobertAchman wrote:
Ok - what if you just want to access the property of the attachment that lets
you know what the CID is for an embedded image attachment?

Do this just using VSTO objects and MAPI properties found within the
MailItem.Attachments[x] item, no third party library...


"Ken Slovak - [MVP - Outlook]" wrote:.
On Wednesday, September 17, 2008 9:19 AM Ken Slovak - [MVP - Outlook] wrote:
VSTO has nothing to do with it.

Unless you are using Outlook 2007 where you can use the new PropertyAccessor
object of the Attachment then you can't do what you want using only the
Outlook object model. If you are using Outlook 2007 you could use something
like this to get PR_ATTACH_CONTENT_ID, assuming that "oAtt" is an attachment
object:

oAtt.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x3712001E")

Note that what looks like an URL is actually the property tag for
PR_ATTACH_CONTENT_ID using DASL syntax and is passed as a string.

You couldn't use CDO 1.21 for that, it's not supported for any managed code.
You couldn't use Extended MAPI, that's also not supported for managed code
and is only programmed using C++ or Delphi.

So those are your choices, use Outlook 2007 or Redemption or forget it.




news:[email protected]...
 
Back
Top