-
Delete emails after attachments are saved
Hi,
I have the code below which is saving attachments from an Outlook subfolder to a directory. Once these attachments are saved I want to delete the emails.
I've been told to use Item.Delete but the loop isn't working, it only picks up the first mail and then moves onto the rest of the code.
Any ideas how to get around this?
Here is the loop:
[VBA]'Saves email attachments
For Each Item In SubFolder.Items
For Each Atmt In Item.Attachments
If Right(Atmt.FileName, 3) = "xls" Then
FileName = "N:\Investment\Performance Measurement\PERFMEAS - NUIM\EQUITY\CFD\59065\" & Atmt.FileName
Atmt.SaveAsFile FileName
Item.Delete
i = i + 1
End If
Next Atmt
Next Item[/VBA]
Thanks
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules