I select 3 emails, all of which have attachments. The code loops through and
sees all 3 emails, but only removes attachments from the 1st one. Any help
is appreciated.
Dim objOutlook As Outlook.Application
Dim objMsg As Object
Dim objAttachments As Outlook.Attachments
Dim objSelectedItems As Outlook.Selection
Dim i As Long, lngCounter As Long
Set objOutlook = CreateObject("Outlook.Application")
Set objSelectedItems = objOutlook.ActiveExplorer.Selection
For Each objMsg In objSelectedItems
If objMsg.Class = olMail Then
Set objAttachments = objMsg.Attachments
lngCounter = objAttachments.Count
If lngCounter > 0 Then
For i = lngCounter To 1 Step -1
objAttachments.Item(i).Delete
Next i
End If
End If
Next
Michael Bauer [MVP - Outlook] - 22 May 2008 18:36 GMT
Call objMsg.Save after deleting all oof its attachments.

Signature
Best regards
Michael Bauer - MVP Outlook
: Outlook Categories? Category Manager Is Your Tool:
: <http://www.vboffice.net/product.html?pub=6&lang=en>
Am Thu, 22 May 2008 10:10:01 -0700 schrieb Access101:
> I select 3 emails, all of which have attachments. The code loops through and
> sees all 3 emails, but only removes attachments from the 1st one. Any help
[quoted text clipped - 26 lines]
>
> Next