Counting Attachments in Messages

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have code that prompts the user for certain infomation before a message
sent. If there are attachments to the message, certain other infomation is
necessary. I am attempting to use mailitem.attachments.count to do this, but
i find that when i send a message, there is a count of one attachment (some
of the time) in the file when i have included no attachments.

My first guess is that this is because my message is HMTL format and there
is some "invisible" attachment to the message, but i am curious if i am
missing something.

Any suggestions?

Using Outlook 2003 w/ Exchange Server
 
Am Tue, 20 Jun 2006 09:43:02 -0700 schrieb Chris Rhodes:

Using CDO 1.21 or Redemption (www.dimastr.com) you can look for the field
PR_CONTENT_ID. If it exists it´s an embedded attachment and probably one of
those you don´t want to count.
 
I think the attachment is the starionery that is used for the message. What
i really want to do is be able to work around this attachment, but the
problem is it does not always exist as an attachment.

Is there any way to determine what "type" of attachment exists so i can code
a way around this issue? An attachment type? A file extension for
stationery, etc.?

Any help is greatly appreciated.
 
The method Michael suggested is the one you need to use to determine whether it's a "real" attachment.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Some embedded messages don't have a PR_CONTENT_ID property in the attachment
object. That's especially true if the item is an RTF email. Two other
properties also need to be checked for a complete solution:
PR_ATTACH_CONTENT_LOCATION (0x3713001E, a PT_STRING8 property that if it
exists means an embedded attachment) and PR_ATTACH_METHOD (0x37050003, a
PT_LONG property that if it equals 6 means an embedded attachment).




The method Michael suggested is the one you need to use to determine whether
it's a "real" attachment.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Am Wed, 21 Jun 2006 09:56:19 -0400 schrieb Ken Slovak - [MVP - Outlook]:

Thanks, Ken.
 
Back
Top