A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Counting Attachments in Messages



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old June 20th 06, 05:43 PM posted to microsoft.public.outlook.program_vba
Chris Rhodes
external usenet poster
 
Posts: 2
Default Counting Attachments in Messages

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
  #2  
Old June 21st 06, 06:01 AM posted to microsoft.public.outlook.program_vba
Michael Bauer
external usenet poster
 
Posts: 435
Default Counting Attachments in Messages

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.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --


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

  #3  
Old June 21st 06, 01:28 PM posted to microsoft.public.outlook.program_vba
Chris Rhodes
external usenet poster
 
Posts: 2
Default Counting Attachments in Messages

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.

"Michael Bauer" wrote:

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.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --


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


  #4  
Old June 21st 06, 01:52 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Counting Attachments in Messages

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
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Chris Rhodes" wrote in message ...
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.

"Michael Bauer" wrote:

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.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --


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


  #5  
Old June 21st 06, 02:56 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Counting Attachments in Messages

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).

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Sue Mosher [MVP-Outlook]" wrote in message
...
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
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


  #6  
Old June 21st 06, 04:57 PM posted to microsoft.public.outlook.program_vba
Michael Bauer
external usenet poster
 
Posts: 435
Default Counting Attachments in Messages

Am Wed, 21 Jun 2006 09:56:19 -0400 schrieb Ken Slovak - [MVP - Outlook]:

Thanks, Ken.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --


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).

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Sue Mosher [MVP-Outlook]" wrote in message
...
The method Michael suggested is the one you need to use to determine

whether
it's a "real" attachment.

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
outlook is miss counting contacts, why Rosalind Outlook - Calandaring 0 April 13th 06 07:12 PM
Forwarding messages with attachments Gurny Outlook Express 12 March 7th 06 07:12 PM
HTML messages creating .eml attachments Tim Outlook - Installation 1 March 2nd 06 09:51 PM
Counting meetings monthly/annually yiftach Outlook - Calandaring 2 February 25th 06 02:04 PM
Outlook should have a function for counting the number of days Bruce McGinn Outlook - Calandaring 0 January 30th 06 01:01 PM


All times are GMT +1. The time now is 05:54 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.