Some users have configured more than one email account in Outlook and set one as the default account. But, they also wish Outlook to auto forward specific incoming emails through another account. Outlook doesn’t have such a function, so it can be realized only with the VBA code shared in this article.
For instance, you have set up two POP3 email accounts in your Outlook and set Account 1 as the default account. Thereby, all incoming emails would be saved in the Outlook file of Account 1. And you create an Outlook rule to auto forward the specific incoming emails to someone else. Now, what you hope is that all the mail forwarding are executed through another email account, namely Account 2. However, Outlook rule doesn’t provide such an action. Thus, you have to use other methods, such as the following way.
Auto Forward Specific Incoming Emails via a Different Account
- To begin with, in Outlook, access VBA editor via “Alt + F11”.
- Then, in the VBA editor, put the following VBA code into an idle module.
Sub AutoForwardMailsThroughAnotherAccount(objMail As Outlook.MailItem) Dim objForwardMail As Outlook.MailItem Dim objRecipient As Outlook.Recipient Dim objMailAccounts As Outlook.Accounts Dim objMailAccount As Outlook.Account Set objForwardMail = objMail.Forward 'Change the recipients of forwarding email Set objRecipient = objForwardMail.Recipients.Add("email@example.com") objRecipient.Type = olTo objForwardMail.Recipients.ResolveAll Set objMailAccounts = Outlook.Application.Session.Accounts For Each objMailAccount In objMailAccounts 'Replace "John Smith" with the display name of your email account If objMailAccount.DisplayName = "John Smith" Then objForwardMail.SendUsingAccount = objMailAccount objForwardMail.Send End If Next End Sub
- Next, exit the VBA editor.
- Subsequently, click “Rules” > “Manage Rules & Alerts” on “Home” tab.
- Then, in the new dialog box, hit “New Rule”.
- After that, another dialog box will display, in which you need to select “Apply rule on messages I receive” and click “Next”.
- Next, in the new screen, you need to set the rule condition, like “with specific words in the subject” and hit “Next”.
- In the subsequent screen, you have to select “run a script” and select the new macro you added just now.
- After that, you can finish the rule setup according to the onscreen wizards.
- From now on, every time when a specific email lands into the specific mailbox, Outlook will auto forward it through another specific email account.
Salvage Outlook Data after Damage
Although Outlook provides quantities of functions, it still cannot be free of errors and corruption. If your Outlook crashes suddenly, there is a bad chance that your Outlook data file may be corrupted. At that time, even the inbuilt Outlook repair tool, Scanpst, is unable to help you. You have no alternative but to take aid of a formidable external tool, like DataNumen Outlook Repair.
Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including corrupted sql and outlook repair software products. For more information visit www.datanumen.com