Trumblog

How To Remove Attachments From Emails in Outlook

I have a 500,000kb limit for my email account and my work signature with a 44kb logo included. At an average of 50 emails a day that means that in less than a year I’m over my limit due to this logo alone. I tend to hoard email and use it as a record that I can refer to later and attachments can be a critical part of that record. Therefore I’m unlikely to delete emails or archive them regularly. Sent email is a different matter since I already have any attachment on my hard drive. However I do want to keep a record of what attachment I sent. What would be perfect would be the ability to strip attachments from a group of emails while leaving a record of what attachments were removed like this…

An email with attachments removed and notated

Outlook, which I use for work email, only allows you to remove emails from an open email, meaning you can only remove them one at a time. Luckily there is a macro that will remove attachments from multiple emails at once and inserts the name of the removed attachment into the body of that email. And you can add it to the toolbar as a button. Here’s how you do it.

Note: this macro does not save the attachments it just deletes them. If you want to save the attachments you must do so separately.

1. Go to Tools > Macro > Security and select the Trusted Publishers tab to make sure that “Trust all installed add-ins and templates” is checked.

Macros Security Trusted Publishers

Back on the Security Level tab, select “Medium” and click “OK”. This will still protect you from unsafe macros, but let you allow this macro to be run when you want it to.

Outlook Security Pop-up Window

2. Go to Tools > Macro > Visual Basic Editor.

3. In the Project window in the upper left, doubleclick on “ThisOutlookSession” which will open a window on the right.

MS Visual Basic

4. Paste the code for the macro, which can be found on Nicola Delfino’s blog, into the window and save.

VBAProject Window

5. Create a digital certificate.  Nicola covers it in her blog, but for simplicity’s sake here it is as well.  Go to start->office->Microsoft office tools->digital certificates for VBA, enter your new certificate’s name and click OK.

Create Digital Certificate

6. Back in Microsoft Visual Basic select Tools and Digital Signature.  Click Choose, select the certificate that you just created then click OK.  Back on the Digital Signature popup click OK and you are done.

Digital Signature

At this point you can run the macro to remove attachments from the selected emails and add notation about the file that was removed. But wouldn’t it be handy if you could run this macro from the toolbar? That’s what I thought. Here’s what you do.

1. Go to Tools > Customize and click on Macros in the Categories.

Macros selected in the Customize window.

2. Click on the Command Project1.ThisOutlookSession.StripAttachments and drag that to one of the toolbars in Outlook.

3. With the Customize window still open, right click on the new command which will activate the Modify Selection button.

4. Click Modify Selection and click into the window beside Name.

Modify Selection Menu

5. Edit the name of the Command’s button to “Strip Attachments” for example.

Edit Name of Menu Button

6. Close the window and you’re done!

Strip Attachments Button

To use the button, click on a message or a group of them and click the new button. The following alert will be triggered, which is ok.

Allow E-mail Address Access Alert Window

Click “Yes” or if you are stripping attachments from a group of emails you may want to allow access for a few minutes so that you don’t see this alert for each email.

Allowing access for 5 minutes

If that message is really killing you.  Click Yes from Context Magic to get rid of the Outlook message.  Personally, I just live with it.

That’s all there is to it. Enjoy!

1 Star2 Stars3 Stars4 Stars5 Stars (4 votes, average: 5.00 out of 5)
Loading ... Loading ...

41 Responses to “How To Remove Attachments From Emails in Outlook”

  1. Brilliant…. works perfectly!! Thanks.

  2. Glad to have helped. Enjoy, rate the post and spread the word!

  3. Very useful tool, thanks!

  4. Nice post. This is my first time I’m visiting your blog and I’ve seen some of your earlier posts too. Interesting!

  5. Generally Ido not post on blogs, but I would like to say that this post really forced me to do so! really nice post.

  6. Great post, while i as searching for blogs, i found yours on Yahoo , that was what i was looking for, great blog, Stumble UP :) Andy – Chicago Area

  7. Great and Excellent article post, i was looking for this information on google while i found your info, definely i Digg your blog post ! Cheers , Collin – New York

  8. Great article. I will link back from my site. Please post more often if you have time. Thanks!

  9. Tried it with no success. you might wanna split the code in two, the injector isnt working.

  10. Ben – I just added this macro to my new laptop and it worked fine, BUT there are a couple of things that Nicola covers in her blog and I did not spell out. I’ve added them now.

    1. Make sure that in Outlook, Tools > Macro > Security on the Trusted Publishers tab that “Trust all installed add-ins and templates” is checked.

    2. Create a Digital Certificate and select it, which I describe above in steps 5 and 6 for producing the macro.

    Good luck and let me know if this helps you out.

  11. Last day we have discussed about this with one of my friends. Information that you gave cleared our questions.

  12. 24.115.217.238: Proxy not working!

  13. Excellent, well detailed explanation, but where does the file get saved?

  14. Milo – the macro removed and deletes the attachments, it does not automatically save them to the hard drive. If you want to save the attachments you must do so before running the macro. I state that I primarily use the macro with sent email where I already have copies of the attachment I do not specifically say that the macro does not save a copy of the attached file. I’ll add a note about that in the post.

  15. I have modified it a bit and it is actually capable of saving attachment as files

  16. try: extract email attachments

  17. Margo – looks like a good add on to Outlook, have you used it and what did you think of it? Attachments Processor for Outlook is $39 and the option that I describe is free.

  18. This is very helpful. I have been able to strip the attachments, but in your very first step “Go to Tools > Macro > Security”, I do not have anything on the Trusted Publishers tab to check. It is blank. Is that a problem? Everything seems to work.

  19. If it’s working then I wouldn’t worry about it. Thanks for the heads up for anyone else who is missing the Trusted Publishers tab also.

  20. Hi Thomas,

    Is it mandatory to install Context Magic from: http://www.contextmagic.com/express-clickyes

    for this to work?

    Also, it seems that my company has disable access to creating digital certificates, is there an alternative way to get this to work?

    Regardless, great guide for a very useful function.

    Cheers.

  21. No Context Magic is definitely NOT mandatory. Without it you will have to click through the Outlook message, but I personally don’t find it so burdensome so I go without.
    I don’t have a workaround for digital certificates being disabled on your system. Sorry and good luck.

  22. Bin dabei

  23. This seems to work for me but most times it tries to save a .doc version of the email to My Documents. I don’t know why. If I just hit “cancel” nothing happens and it proceeds as normal.

    Not a big problem except that I have to hit “cancel” a hundred times while cleaning out my sent items folder.

  24. Scott – haven’t had that issue before. Let me know if you find out the issue and solution then post it for others. Thanks.

  25. Same problem as Scott – it tries to save the attachment with as from.doc. The entry in the email has the correct file name, but the save as dialog doesn’t.

  26. I just set this up and it works very well. Only one question – when you run it it asks if you want to save the file (fine, just hit cancel if you don’t want to save it before stripping it from the email) but if you do want to save it, it suggests the file name as the first line in the email rather than the file name of the attachment. So if you have an attachment to an email that starts with Hi Bob, the suggested file name is “Hi Bob”. At the same time the attachment does not appear in the email so you have to write the name down if you want to use the same file name (if it is a long name and difficult to remember).

  27. I had left a comment about the file name for a file to be saved and it appears the comment was deleted. Why?

  28. Robert – the comment was not deleted, just hadn’t been approved. Thanks for the reminder.

  29. Thanks for the clarification. It is a change to the macro that would be really useful if it could be done.

  30. Agreed. Unfortunately I’m better at step by step instructions than at writing macros. If a reader knows of a better macro please let me know it the comments and I’ll update the instructions.

  31. Great post! Very useful! Keep up the good work!

  32. Dear Thomas,

    Thank you very much for this.

    It has saved me heaps of time!

    Best wishes,

    Sam.

  33. OMG, I’ve never done Visual Basic before, and everything worked perfectly! WOW@!

  34. Quite useful !
    Thanks a lot !

  35. Hello – great code that actually works!!

    I need to just delete attachments, what line should I add in order to “Cancel” automatically when asked “do you want to remove attachments from selected file?”

    Thanks

  36. This is excellent, works perfectly!!
    Would you know the modifictaions so that it skips the save attachments section? I dont need the attachments saved just evidence that the there was an attachment in email – which the saving the file name in the email covers.
    Cheers

  37. I don’t know, but if you update the macro with this please share the results.

  38. Jen – sorry I don’t know that. If you figure it out, please add it to the comments for the rest of us.

  39. did anyone work out how to not have to save as a word file? it’s driving me nuts!

    Apart from that great post!

    Thanks

    Catherine

  40. Love the macro. Just switched to Outlook 2010, though … do you have instructions for how to install the macro in Outlook 2010?

  41. Thank you! works perfectly!

Leave a Reply

Additional comments powered by BackType