Set objNamespace = objOutlook.GetNamespace("MAPI") The Date field can either be SentOnor ReceivedTime when you are working with email or meeting request and responses.ĭim objSourceFolder As Outlook.MAPIFolder Tested in Outlook 2010 and Outlook 2013 with an Exchange mailbox. You'll need to change this as well as the folder path you are moving the email to. In this sample, the data file name is an email address because that is what Outlook 2010 uses for data file names. You'll also need to replace the data file name. You'll need to set the age, in days, to your desired number. This code sample checks the default Inbox for email older that 7 days and moves any it finds to a subfolder of the Inbox, called Old. " Macro to file Outlook email by sender's display name" has versions that file into folders by name, domain, or date. The code sample gives you the code needed to move only messages you've replied to or forwarded. The third macro on this page shows you how to use a Select Case statement to move different Outlook items types, using a different age for each item type. Two macros show you how to move messages to a folder within your current data file and to move messages to a folder in a new data file. There are 4 macros on this page plus one code snippet. If you aren't a big fan of moving mail, you can leave it in the Inbox and use custom views to hide older mail.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |