Link to home
Create AccountLog in
Avatar of adamchicago
adamchicago

asked on

Outlook 2003: Move Old Mail To Folder

Hi Experts, can you please share a VBA script that will automatically move mail from the Inbox to a custom named folder ("OldInbox") that is 3 weeks or older?

Thank you.
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of adamchicago
adamchicago

ASKER

Awesome...thank you!  However the destination folder is an "Archive Folders" folder...how should the code be changed to accommodate that?

Thanks again.

Adam
Oh one other question...where do I paste this data? ..."ThisOutlookSession"?

I'm a seasoned Excel VBA'r but have never used VBA in Outlook before.
So where is the destination folder, relative to the Inbox?  Is it a in separate PST or something?

~bp
Just right click on ThisOutlookSession, create a new module, and place the code in there.

~bp
NOT FOR POINTS

Place your selection on the explorer folder where you require the mails to be moved and then in the immediate window, (ctrl + G to display) type:


?application.ActiveExplorer.CurrentFolder.FolderPath

Put the response here and Bill can modify the script more easily for you.

Chris
==> Chris

Is there any easy way to get the folder object from the path, or does it still need to be done via something like:

http://msdn.microsoft.com/en-us/library/bb177014%28v=office.12%29.aspx

~bp
HI Bill

Welcome to 2011!

Nope that's the way ... although I have my own version that meets my needs.

Of course you can use relative indexing i.e. if it's a pst parallel to the inbox then go up 1 and then across and down but having got the string from the folderpath it makes more sense to use it directly as the application is clearer.

Chris
Same to you Chris, thanks.

~bp
==> adamchicago

Let me know how you are getting on, and if you have the path to the destination folder.

~bp
Just got back to my work computer and saw all of your responses...wow thanks for all the help!

I'm a little confused by "explorer folder"...do you mean the folders on the left side of the window WITHIN Outlook, or do you mean the actual Windows Explorer folders?  If its the Outlook folders you're referring to I tried highlighting the destination folder and then clicking-in the VBA immediate window and doing ctrl + G and nothing happened.  If it's the later (Windows Explorer folder) I do not know which Windows C:drive folders Outlook uses what is the path to these folders and how do I know which folder corresponds to the Outlook folders.

Just a step back, I'm looking for a script that will move email greater than two weeks old automatically from the Outlook Inbox to an "Archive Folders" named "Old Inbox2".

Thanks again!!!!
Whoops I mis-understood...not enough caffeine flowing yet;)

Here's the response in the immediate window for the destination folder:

\\Archive Folders\Old Inbox2
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Thanks Chris.  Let us know how that goes adamchicago, Chris has changed to reference your destination folder.

~bp
That did it...thank you very much Bill and Chris you've been a huge help!

Adam
Great, glad we could help.

~bp