Can multiple Outlook 2003 attachments be removed with one keystroke?

In Outlook 2003 it is possible to Select All, then Copy and Paste all attachments to a folder for backup.  But if I subsequently want to delete them all at once, the Remove option is grayed out and the Delete Key is disabled (this was not the case with Outlook 2000 - it was easy to select and remove all attachments from an e-mail with one keystroke).  I have Googled this extensively and am stunned that Microsoft MVPs are making already incredulous questioners even more angry by repeating the primitive steps, but which to remove attachments one-by-one, as if the questioners were simpletons.

I am similarly incredulous about Microsoft answers that changes in Outlook 2003 vs. 2000 were "for security reasons" and offended by their senseless broad answers and refusal to date to answer specifically and simply what I asked above.  How can permanently removing all attachments at once be possibly a security risk - and be a security risk when compared with removing them one at a time with the primitive procedure?  I had always thought of them as courteous, which would include to simply say, sorry, the feature is not implemented, you will have to delete attachments one-by-one in Outlook 2003, instead of never answering the question directly.

Thank you very much in advance.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David LeeCommented:
Hi, brnbrg.

I don't work for Microsoft so I can't answer your questions about why Outlook works this way, nor can I explain why you can't get a straight answer from Microsoft.  I can however provide you with a solution that'll allow you to remove all attachments with a single mouse click.  It involves a little scripting and adding a toolbar button.  If you're interested in it, then let me know and I'll post the code and instructions for using it.
brnbrgAuthor Commented:
I was once a pretty heavy FORTRAN 77 programmer and can get macros running in Excel, but will have to leave it up to your judgment whether your code is too advanced for me or not.  I also wonder whether Outlook 2007 will be even worse and whether I can use that code then (?).  Ah, what the heck, let's give it a shot - I'll let you know if I am too dumb to implement it - but with your instructions I'll be OK, so let's do it.


P.s.:  By the way, I was not alone and I was not the one, who got that simple removal instruction as an answer to what we're really asking here, but the forums are full with that question and one guy finally got white-glowing hot with anger over those formal "non"-answers from Microsoft.  it would be almost funny if those Redmond monopolists would not steal so many hours senselessly from our lives.  Many called 2003 a "downgrade" from 2000...  Is Office 2007 even worse?

Being from Europe, I first thought it can't be that you're naming yourself after a ceiling fan, so my lasersharp mind tells me that you then must be Duke University Blue Devil Fan, right?  And let me guess, out of the 20 sports of the ACC it is most likely Men's Basketball, right?  Football would be my second guess...
David LeeCommented:
Hi, Bernard.

Here's the code for doing this.  It's very simple.  All it does is loop through the Attachments collection deleting each item.  Very straightforward.  This will work with 2003 and 2007.  It should work with any version from 2000 forward, but I don't use any of them anymore and haven't tested to verify that.  

One caveat.  Outlook stores embeded images as hidden attachments.  This code will remove them too.  

Follow these instructions to set the code up in Outlook.

1.  Start Outlook.
2.  Click Tools->Macro->Visual Basic Editor.
3.  If not already expanded, expand Modules and click on Module1.
4.  Copy the code below and paste it into the right-hand pane of the VB Editor.
5.  Click the diskette icon on the toolbar to save the changes.
6.  Close the VB Editor.
7.  Click Tools->Macro->Security.
8.  Change the Security Level setting to Medium.
9.  Select a message with one or more attachments.
10.  Run the macro (Tools->Macro->Macros, select this macro, click Run)

Once you've tested the code and are satisfied that it works, follow these instructions to add a toolbar button that'll run this at the click of a mouse.

1.  Click View->Toolbars->Customize
2.  Click the Toolbars tab
3.  Click New
4.  Name the toolbar
5.  Click the Commands tab
6.  Under Categories click Macros
7.  Under Commands click and hold on the macro Project1.DeleteAllAttachments, then drag it out and drop it on the new toolbar
8.  Dock the toolbar somewhere onscreen
9.  You're ready to go

I did a little FORTRAN programming once upon a time.  At the time it was a handy language for utility programs that would have taken many more lines of code in COBOL.  

Your mind is laser sharp.  Some other Europeans I've talked to here on EE thought I was a fan of a football (soccer to us in the U.S.) club.  You got it right.  I am a dedicated Duke University basketball fan.  Football isn't Duke's strong suit.  I think their team has only won 1 game in the last 2-3 years.  Where are you in Europe?  I spent a few years in Belgium in the early 80's.
Sub DeleteAllAttachments()
    Dim olkItem As Object, _
        intIndex As Integer
    If TypeName(Application.ActiveWindow) = "Inspector" Then
        Set olkItem = Application.ActiveInspector.CurrentItem
        Set olkItem = Application.ActiveExplorer.Selection(1)
    End If
    For intIndex = olkItem.Attachments.Count To 1 Step -1
    Set olkItem = Nothing
End Sub

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

brnbrgAuthor Commented:
I'm so far removed from syntax that I have to ask, when you say
4.  Copy the code below and paste it into the right-hand pane of the VB Editor.
Do you mean with or wihout the line numbers, because when I tried to highlight your solution, the line numbers highlighted along with the syntax of the commands (sorry for asking such a basic question)...

I have to admit I "cheated" in the sense that I am from Vienna, Austria, but live here in the US for a long time.  Hence, a Blue Devil Fan is, of course, most likely a Duke Basketball Fan, because that's where they shine, their other teams are far less likely to invoke an EE engineer as a fan...  For us Europeans there is soccer and for Austrians there is skiing as you know.  If we lose in downhill, all flags are flown at Half-Staff!  Quite similar to being a Blue Devil Fan...
David LeeCommented:
Without the line numbers.  I think it's a little easier to avoid the line numbers if you click the Open in New Window link at the bottom right side of the snippet window and then block and copy from there.

LOL.  Yes, I can well imagine that it is a national day of mourning when Austria loses at downhill.  Fortunately, I don't think that happens very often.
brnbrgAuthor Commented:
Sorry for the delay, I had lost my machine there for a few days, major mess with NTFS data scopy disk-to-disk backups, will have to ask a separate question for that...  Thanks again!
David LeeCommented:
No worries, Bernard.  Cheers!
brnbrgAuthor Commented:
Hi BlueDevilFan,

Can you look at my second question, which apparently nobody wants to tackle - I don't know how to direct you to it - but those hard drive issues really hurt me...  I should disclose that I am quite diabled after an explosion accident, which cost me parts of my left hand, one eye etc.  I was 4 years in the hospital and after 62 operations, well, I;m sort'a stitched together, if you know what I mean...  Maybe you can just give me some basic advice how to set up a 2nd hard drive without those lag issues I've been experiencing, I hope you can find my new open question...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.