Link to home
Start Free TrialLog in
Avatar of sav2880
sav2880Flag for United States of America

asked on

Batch Removal of Attachments (.PST and Exchange Server stores)

Hello! Need some help from the masses:

I need to see if there is a way or utility that allows you to batch delete all (or some based on date) attachments on a Microsoft Exchange server mailbox or an external .PST file.

We have some users who have large mailboxes strictly due to attachments and I would like to have a way to remove these attachments in a more automated way but still keep the messages.

Thanks!
Avatar of David Lee
David Lee
Flag of United States of America image

Hi sav2880,

I can do this with a macro, if that's an option.  I'd need to know whether this is for your mailbox or other staff's mailboxes.

Cheers!
Avatar of sav2880

ASKER

This would be a tool that we would allow people to use on their own mailboxes (had to get that clarified).

So some kind of macro that could be deployed where we could tell people that this would strip a folder / PST / mailbox of attachments would be ideal.
ASKER CERTIFIED SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sav2880

ASKER

Is there a way to update this macro so that the user can specify a folder to save the attachments into?

I ask because we are asking users to organize their mail and they may want to move a specific folder's attachments into a specific project file chosen at the time of the macro's creation.
You can set the save to folder to whatever you want and different employees could use different folders.  I included a comment immedaitely before where the folder name is set.  Or am I not understanding the question?
Avatar of sav2880

ASKER

You're close. :)

I'm looking to see if that can be defined at the time of the macro's execution, through a dialog or drop down folder box of some sort (which I'm sure gets into calling API's and the such). Reason being, one of our users may be working on five projects (which will have their own folders, actually, PST files to be exact) and I would want each user to save the attachments from each project into a different folder.

I suppose I could set up macros for each folder, but that's a lot of legwork where a single macro allowing the user to select the folder at runtime would allow it to work with a single macro.
Got it.  Sorry, I wasn't making the connection to what you were asking.  There are several ways of doing this.

1.  Show a dialog-box each time asking for the path to save to.  This is the easiest way to go, but also a dangerous one.  It's dangerous because the user could enter the wrong path and the attachments would all go to the wrong folder.  

2.  Build a list of project/folder associations into the script.  When the script ran it'd check the folder it was running against and use the matching folder.  If there was no matching folder it would abort.  This is a better approach than #1.  The down side is that to add a new project, folder, or to change the association of either one requires editing the script.

3.  Use an .ini file to store the project/folder associations.  This is essentially #2 with the list now external to the script.  This eliminates the need to edit the script to make changes to the project/folder associations.  

4.  Set the script to store all attachments in sub-folders under a root folder.  The sub-folder names would match the folder names in Outlook.  Assume the root folder is C:\My Attachments.  If I ran the script against an Outlook folder named Project A, then the attachments would all go to C:\My Attachments\Project A.  This is the best possible approach.  You don't have to do anything except run the script.  

Let me know how you'd like to proceed and we'll take it from there.
Any update, sav2880?
Avatar of sav2880

ASKER

Sorry, fell a bit into the background here. I'm gonna jump back into this over the course of this week.
Avatar of sav2880

ASKER

Probably not going to get back to this quickly, and the answer above actually is going to serve the purposes needed now, so much thanks! :)
You're welcome.