See it in Action!Watch this video to see this macro in action.
The CodeHere is the code behind this macro.
'Leverage & Lean "Less Clicks, More Results" Sub MoveOldEmails() ' Means variable is in use Dim OutlookApp As Outlook.Application ' Dim OutlookNS As Outlook.NameSpace ' Dim StartFolder As Outlook.MAPIFolder ' Dim StartFolderItems As Outlook.Items ' Dim EndFolder As Outlook.MAPIFolder ' Dim EndFolderTitle As String ' Dim CurrentEmail As Integer ' Dim Email As Outlook.MailItem ' On Error GoTo LeverageLean EndFolderTitle = "Old Emails" 'Replace "Old Emails" with the End Folder Title. Set OutlookApp = Outlook.Application Set OutlookNS = OutlookApp.GetNamespace("MAPI") Set StartFolder = OutlookNS.GetDefaultFolder(olFolderInbox) 'Default Outlook Account's Inbox 'Set StartFolder = OutlookNS.Folders("ACCOUNT NAME").Folders("Inbox") 'Different Outlook Account's Inbox Set StartFolderItems = StartFolder.Items Set EndFolder = StartFolder.Folders(EndFolderTitle) For CurrentEmail = StartFolderItems.Count To 1 Step -1 'Loop through emails in Start Folder Set Email = StartFolderItems(CurrentEmail) If Email.UnRead = False And Email.FlagStatus <> 2 And Email.Categories = "" Then Email.Move EndFolder 'If Email is Read, has no Flag Marked, and no Category set. Move the End Folder End If Next 'Criteria Details: 'Email.UnRead = False if Email is Read OR Email.UnRead = True if Email is NOT Read 'Determine FlagStatus of Current Email. 0=None 1=Flag Complete 2=Flag Marked 'Email.Categories = "" OR Email.Categories = "Category Name" Set Email = Nothing Set EndFolder = Nothing Set OutlookApp = Nothing Set StartFolder = Nothing Set StartFolderItems = Nothing Exit Sub LeverageLean: MsgBox ("Something went wrong. Ensure the path is correct to the Start Folder and End Folder. Don't hesitate to email me: email@example.com") End Sub 'Stay Awesome
Macro InstructionsWatch this video to get started using this macro.
CustomizationThese lines of code can be customized to personalize this macro.
15 EndFolderTitle = “Old Emails” ‘Replace “Old Emails” with the End Folder Title.
20 ‘Set StartFolder = OutlookNS.Folders(“ACCOUNT NAME”).Folders(“Inbox”) ‘Different Outlook Account’s Inbox
26 If Email.UnRead = False And Email.FlagStatus <> 2 And Email.Categories = “” Then
‘Email.UnRead = False if Email is Read OR Email.UnRead = True if Email is NOT Read
‘Determine FlagStatus of Current Email. 0=None 1=Flag Complete 2=Flag Marked
‘Email.Categories = “” OR Email.Categories = “Category Name”
If you want to StartFolder to NOT be the Inbox Add .Folders(“Sub Folder Name”) has to be added to the end of the StartFolder path in code line 19