removing multiple attachments

K

Kasra

How do I remove multiple attachments from a received email using Outlook
2003? Currently, I can only remove 1 file at a time. It becomes a hassle
when there are many attachments.
 
G

Gordon

Kasra said:
How do I remove multiple attachments from a received email using Outlook
2003? Currently, I can only remove 1 file at a time. It becomes a hassle
when there are many attachments.


Select them all and right-click - choose "remove"....
 
K

Kasra

Gordon said:
Select them all and right-click - choose "remove"....

i don't get the 'remove' option when selecting all the attachments. I only
have the 'copy' option. Any other way?
 
D

Duncan McC

i don't get the 'remove' option when selecting all the attachments. I only
have the 'copy' option. Any other way?

I haven't used this vba since Outlook 2003 - but give it a go. You use
this macro on open emails.

Sub DeleteAttachments()
Dim objCurrentItem As Outlook.MailItem
Dim colAttachments As Outlook.Attachments
Dim objAttachment As Outlook.Attachment

Set objCurrentItem = Application.ActiveInspector.CurrentItem
Set colAttachments = objCurrentItem.Attachments
' Set strFolderpath = CreateObject("WScript.Shell")

While colAttachments.Count > 0
colAttachments.Remove 1
Wend

Set objAttachment = Nothing
Set colAttachments = Nothing
objCurrentItem.Save
objCurrentItem.Close (olDiscard)
Set objCurrentItem = Nothing

End Sub

If you have an email you want to save 'em all:
Sub SaveAttachments()
Dim objCurrentItem As Outlook.MailItem
Dim colAttachments As Outlook.Attachments
Dim objAttachment As Outlook.Attachment

Set objCurrentItem = Application.ActiveInspector.CurrentItem
Set colAttachments = objCurrentItem.Attachments
Set strFolderpath = CreateObject("WScript.Shell")

For Each objAttachment In colAttachments
objAttachment.SaveAsFile (strFolderpath.SpecialFolders("Desktop") &
"\" & objAttachment.FileName)
Next

Set objAttachment = Nothing
Set colAttachments = Nothing
objCurrentItem.Close (olDiscard)
Set objCurrentItem = Nothing

End Sub

IIRC, I modified the save script to save to a folder, and not the
desktop - quite trivial.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top