Previous Thread:   'CTRL + A' in Outlook View Control

9/23/2005 4:09:03 AM    Attachment delete method
Hi everybody,  
  
I use OL 2003 and I use the following code to save the incoming mail  
  
attachments (based on a rule of the sender name and subject) on a specific  
  
folder in My Documents, delete the attachments and clear the space:  
  
strControl = subsubfolder.Items.Count  
  
Set olMail = subsubfolder.Items(strControl)     ' to get the last  
  
mailItem moved in the folder by the rule  
  
For Each atm In olMail.Attachments  
  
atm.SaveAsFile "C:\Documents and Settings\..." & atm.FileName  
  
Next  
  
For Each atm In olMail.Attachments  
  
atm.Delete  
  
Next  
  
The problem is that the attachments are not deleted.  
  
I am a newbie with VBA. Can somebody help me please ?  
  
Also, is there any other method which returns the last mailItem received in  
  
a specific folder? How can I use AddItem method in the rule?  
  
Thanks in advance,  
  
Catalin



9/23/2005 9:37:22 AM    Re: Attachment delete method
Take a look at the code sample at  
  
http://www.slovaktech.com/code_samples.htm#StripAttachments. It might help  
  
you.  
  
--  
  
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  
  
"Catalin" <Catalin@discussions.microsoft.com> wrote in message  
  
news:3B372CEE-46EC-41B1-BDFB-9D9559E925A3@microsoft.com...

9/23/2005 11:45:53 PM    Re: Attachment delete method
On Fri, 23 Sep 2005 04:09:03 -0700, "Catalin"  
  
<Catalin@discussions.microsoft.com> wrote in  
  
microsoft.public.outlook.program_vba:  
  
[snip]  
  
From memory, try adding this:  
  
olMail.Save  
  
--  
  
Michael Bednarek   http://mbednarek.com/   "POST NO BILLS"