Many users desire to move specific emails from Inbox to other specific folders after reading them, which will keep the Inbox mail folder clean. But always moving manually will be cumbersome. This article will expose a quick method to realize it automatically.
As usual, every incoming email will land into the Inbox mail folder in Outlook. So, in this case, Inbox folder will be cluttered up and be stuffed over time. More often than not, you can either manually move specific emails to other mail folders or create an Outlook rule to auto move specific emails as soon as they arrive in your mailbox. Applying such a rule is much more convenient, but you have to go to the specific folders to access the new mails. In face of this issue, you may hope that Outlook is able to auto move specific emails from Inbox to other mail folders after you complete reading them in Inbox instead of after they arrive. But Outlook rule can’t realize it. Fortunately, you can use Outlook VBA to make it come true. Here are the codes as well as the elaborate steps.
Auto Move Specific Emails to Specific Folders after Reading Them
- At the very outset, launch Outlook and switch to “Developer” tab.
- Then on this tab, hit “Visual Basic” button to open the VBA editor window.
- Next in the new window, you ought to find the “ThisOutlookSession” project and double click to open it.
- Subsequently copy and paste the following VBA codes into it.
Public WithEvents olItems As Outlook.Items Sub Application_Startup() Set olItems = Session.GetDefaultFolder(olFolderInbox).Items End Sub Private Sub olItems_ItemChange(ByVal Item As Object) Dim deFolder As Folder 'Ensure the email marked as read If TypeOf Item Is MailItem And Item.UnRead = False Then 'Check the email subject and then move to specific folder 'You can change these conditions and folders as per your needs If InStr(LCase(Item.Subject), "test") > 0 Then Set deFolder = Session.GetDefaultFolder(olFolderInbox).Parent.Folders("Test") Item.Move deFolder End If If InStr(LCase(Item.Subject), "worklog") > 0 Then Set deFolder = Session.GetDefaultFolder(olFolderInbox).Parent.Folders("WorkLog") Item.Move deFolder End If If InStr(LCase(Item.Subject), "report") > 0 Then Set deFolder = Session.GetDefaultFolder(olFolderInbox).Parent.Folders("Report") Item.Move deFolder End If End Sub
- After that, you should digitally sign this code.
- First, use the built-in “Digital Certificates for VBA Projects” tool to create a new certificate.
- Then assign this certificate to the current macro. Take the steps shown in the image below:
- Later you ought to change the macro settings to only enable digitally signed macros.
- Finally you should restart Outlook to activate this VBA project. From now on, all incoming emails will still land into the Inbox. But as soon as the new email is read, it will be automatically moved to the specific folders.
Smart Tricks to Resolve Outlook Problems
Due to the fact that Outlook is prone to error, many users long for smart tips to deal with frequent issues. Normally, most common techniques include creating a new mail profile, disabling third party add-ins, repair Office suite and utilize the inbox repair tool, Scanpst.exe. If the built-in tool fails, you can resort to another more potent corrupt Outlook repair utility, like DataNumen Outlook Repair.
Author Introduction:
Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including repair corrupted SQL db and outlook repair software products. For more information visit www.datanumen.com
Leave a Reply