How to Auto Move an Email to a Specific Folder After You Forward It in Outlook

To keep your mailbox in order, you may get used to saving the specific emails in the specific folder. This article will tell you how to use Outlook VBA to auto move the email after you forward it.

Storing the similar emails in a specific mail folder is a good tip to manage a great amount of emails. It is sure that different users must have their own criteria for mail classification and management. For instance, you may prefer to classify your emails as per your follow-up actions on them, such as reply, forward or others. If you would like to auto move the email to a specific folder, like “Forwarded”, when you forward it, you can apply the followings operations and VBA codes to get it in quick time."Forwarded" Mail Folder

Auto Move the Email to a Specific Folder After You Forward It

  1. In the first place, launch Outlook.
  2. Then switch to the “Developer” tab.

Note: If you cannot find this tab, you should go to “File” > “Options” > “Customize Ribbon” to enable it firstly.

  1. After this tab is visible, you can find and click “Visual Basic” button under it.
  2. Subsequently, a new “Microsoft Visual Basic for Applications” window will pop up. In it, you should double click “ThisOutlookSession” project on the left side to open it.
  3. After that, you can copy and paste the following VBA codes into it.
Public WithEvents objExplorer As Outlook.Explorer
Public WithEvents objMail As Outlook.MailItem

Private Sub Application_Startup()
    Set objExplorer = Outlook.Application.ActiveExplorer
End Sub

Private Sub objExplorer_SelectionChange()
    On Error Resume Next
    Set objMail = objExplorer.Selection.Item(1)
End Sub

Private Sub objMail_Forward(ByVal Response As Object, Cancel As Boolean)
    Dim objInboxFolder As Folder
    Dim objTargetFolder As Folder
 
    Set objInboxFolder = Outlook.Application.Session.GetDefaultFolder(olFolderInbox)
 
    On Error Resume Next
    Set objTargetFolder = objInboxFolder.parent.Folders("Forwarded")
    If objTargetFolder Is Nothing Then
       Set objTargetFolder = objInboxFolder.parent.Folders.Add("Forwarded")
    End If
    objMail.Categories = "Forwarded"
    objMail.Move objTargetFolder
End Sub

VBA Codes - Auto Move an Email to a Specific Folder After You Forward It

  1. Later you would be required to sign the new VBA project.
  • Firstly, use “Digital Certificates for VBA Projects” built-in tool to create a digital certificate.
  • Then assign the certificate to this macro, like the following screenshot:Digitally Sign the New VBA Project
  1. Later you can change your macro settings to permit digitally signed macros.
  2. Finally restart Outlook to activate the new macro. From now on, when you select an email and click the “Forward” button, the email will be moved to the “Forwarded” folder at once.

Avoid Undesired Outlook PST Data Corruption

One of the most troubles which have plagued Outlook users for a long time is that Outlook is prone to corruption. That is to say, suffering PST damage is a common matter. Therefore, in order to prevent losing outlook data, you had better make a consistent and up-to-date backup for your PST data.

Author Introduction:

Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including corrupt SQL Server and outlook repair software products. For more information visit www.datanumen.com

Comments are closed.