G
Guest
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
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