Tip

Automatically save Microsoft Outlook email attachments to disk

Discover an easy-to-use and customizable Outlook VBA script that will drop email attachments into a specified Microsoft Outlook folder that then automatically saves them to a directory folder on disk.


I have a terrible habit of letting Microsoft Outlook .PST files bloat up with email attachments, because I never bother to dump the email that contains them (even if I no longer really need them). Manually removing attachments from messages can be laborious.

I've since discovered an Outlook VBA script that automatically saves email attachments and gives me an excuse to

VIEW MEMBER FEEDACK TO THIS MICROSOFT OUTLOOK TIP
 

continue dumping attachments into my Outlook .PST files.

The macro script, authored by Killian, allows attachments to be automatically saved to a directory folder somewhere on disk whenever a message with an email attachment is moved into a specific "watched" Microsoft Outlook folder. These folders can be named anything you want, as the names are spelled out in the script itself and can be modified with relatively little work.

The Outlook VBA script can also be customized:

    Requires Free Membership to View

The VBA script works in Outlook 2002 and 2003, and I have also tested it in Outlook 2007. Regardless of version, however, you'll need to make the appropriate adjustments to your macro security settings to get it to work, since it's an unsigned macro.

About the author: Serdar Yegulalp is editor of Windows Insight, a newsletter devoted to hints, tips, tricks, news and goodies for all flavors of Windows users.

MEMBER FEEDBACK TO THIS MICROSOFT OUTLOOK TIP

I have a question on this tip and the handy script that you've referenced. I read the script and saw the code, but wasn't sure where to go for further reference.

Regarding the VBA script, there is a piece of the code that I'd like to modify for my own purposes.

    Set TargetFolderItems = ns.Folders.Item( _ 
    "Personal Folders").Folders.Item("Temp").Items

How do I modify "Personal Folders" to something else (i.e., NOT a PST)?

Let's say I have a mailbox called Mailbox - Brian Henderson and have the following folders:

Mailbox -Brian Henderson
   project 1
       folder a
   project 2
       folder b

Basically, I'd like to run this on all of my email folders and have them all output to different file folders. Is this possible?

This is a great article... it gave me some great ideas. Thanks so much for pointing it out!
—Brian H.

Do you have comments on this tip? Let us know.

Please let others know how useful this tip was via the rating scale below. Do you know a helpful Exchange Server, Microsoft Outlook or SharePoint tip, timesaver or workaround? Email the editors to talk about writing for SearchExchange.com.
 

This was first published in September 2007

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.