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

Stripping attachments from sent emails



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 20th 07, 10:57 PM posted to microsoft.public.outlook.program_vba
Bill
external usenet poster
 
Posts: 31
Default Stripping attachments from sent emails

I would like to write a VBA tool to strip attachments from emails in Sent
Items. The goal is to clean up mailboxes of users who email many large
attachments (a policy is eventually on its way). However, I cannot seem to
differentiate between an "external" attachment like a Word document and a
small bitmap image (e.g., screen capture) embedded into the body of the
email for illustrative purposes.

I would like to leave embedded images intact and strip what I'm calling
"true" attachments.

Is there any way to differentiate between them?

My code looks at objItem.Attachments.Count and then calls Remove( ).

But the first message it fired on as I tested had only a small embedded
graphic.

I could test for items with Size (some-number) but that's rather
unsatisfying.

Thanks for any ideas,

Bill Le May



  #2  
Old April 21st 07, 08:45 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Stripping attachments from sent emails

Embedded HTML images have PR_ATTACH_CONTENT_ID property set. HTML body
refers to these images in the img src="cid:xyz"... tag (where xyz is the
value of the PR_ATTACH_CONTENT_ID).
You can access that property using Extended MAPI, CDO 1.21 or Redemption
(but not the Outlook Object Model).

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Bill" wrote in message
...
I would like to write a VBA tool to strip attachments from emails in Sent
Items. The goal is to clean up mailboxes of users who email many large
attachments (a policy is eventually on its way). However, I cannot seem to
differentiate between an "external" attachment like a Word document and a
small bitmap image (e.g., screen capture) embedded into the body of the
email for illustrative purposes.

I would like to leave embedded images intact and strip what I'm calling
"true" attachments.

Is there any way to differentiate between them?

My code looks at objItem.Attachments.Count and then calls Remove( ).

But the first message it fired on as I tested had only a small embedded
graphic.

I could test for items with Size (some-number) but that's rather
unsatisfying.

Thanks for any ideas,

Bill Le May





  #3  
Old April 23rd 07, 04:08 PM posted to microsoft.public.outlook.program_vba
Bill
external usenet poster
 
Posts: 31
Default Stripping attachments from sent emails


"Dmitry Streblechenko" wrote in message
...
Embedded HTML images have PR_ATTACH_CONTENT_ID property set. HTML body
refers to these images in the img src="cid:xyz"... tag (where xyz is the
value of the PR_ATTACH_CONTENT_ID).
You can access that property using Extended MAPI, CDO 1.21 or Redemption
(but not the Outlook Object Model).


Thank you for your reply. I have Redemption, but I am uncertain how to
access this property. If I cycle through the Attachments in a SafeMailItem,
how would I determine whether they have this property set? My goal is to
delete only the non-embedded attachments.

Thanks,

Bill Le May


  #4  
Old April 23rd 07, 06:51 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Stripping attachments from sent emails

You can access them using Attachment.Fields(PR_ATTACH_CONTENT_ID) where
PR_ATTACH_CONTENT_ID is 0x3712001e

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Bill" wrote in message
...

"Dmitry Streblechenko" wrote in message
...
Embedded HTML images have PR_ATTACH_CONTENT_ID property set. HTML body
refers to these images in the img src="cid:xyz"... tag (where xyz is
the value of the PR_ATTACH_CONTENT_ID).
You can access that property using Extended MAPI, CDO 1.21 or Redemption
(but not the Outlook Object Model).


Thank you for your reply. I have Redemption, but I am uncertain how to
access this property. If I cycle through the Attachments in a
SafeMailItem, how would I determine whether they have this property set?
My goal is to delete only the non-embedded attachments.

Thanks,

Bill Le May



 




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
Emails always have .htm attachments Dave Richardson Outlook Express 4 December 19th 06 06:03 PM
Stripping Attachments from sent emails? Ken Outlook Express 2 August 9th 06 04:11 PM
Why are emails all attachments HotRod Outlook - General Queries 2 August 1st 06 02:58 PM
Multi emails sent with attachments golfer Outlook Express 1 May 7th 06 02:00 PM
Almost all emails are coming as attachments. Shirley Azvedo Outlook Express 6 May 2nd 06 10:27 AM


All times are GMT +1. The time now is 10:27 PM.


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.