Link to home
Start Free TrialLog in
Avatar of maherusa
maherusaFlag for United States of America

asked on

Outlook 2007 Macro: Move messages On Exit

Hello,

I need help writing a macro in Outlook 2007 that would move certain messages based on a certain sender from Inbox to another folder On Exit (i.e. once I close Outlook). Your help is appreciated.

Thanks.
Avatar of Chris Bottomley
Chris Bottomley
Flag of United Kingdom of Great Britain and Northern Ireland image

Hello maherusa,

There is the Application_Quit event to run a macro.  All it requires is a sub to do the move ... in order to help with which what are the criteria for the mailmove ... addresses affected and directory for the move.

Private Sub Application_Quit()
'    OLQuit
End Sub

Regards,
Chris
Avatar of maherusa

ASKER

Hello Chris,

The move criteria is based on one single email address: from inbox to a directory folder (Note: using Exchange 2003 as the server).

Thanks.
By virtue of the macro this would be a client side operation, i.e. outlook.  WOuld you like me to draft something on that basis?

CHris
Yes please.
WHat is the destination folderpath ... put the cursor on the folder in the explorer then type this in the VBE immediate window(ctrl + G to display):

?application.ActiveExplorer.CurrentFolder.FolderPath

Chris
ASKER CERTIFIED SOLUTION
Avatar of Chris Bottomley
Chris Bottomley
Flag of United Kingdom of Great Britain and Northern Ireland 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