So as to watch out for the emails from unknown domains, some users hope to let Outlook auto highlight them, such as show them in red color. Now, this article will introduce a method to realize it.
In order to block viruses in suspicious emails from attacking your Outlook data, you ought to pay special attention to those emails from unknown domains. Here, in the followings, we will share you a method to let Outlook auto highlight these emails with a manifest color.
Auto Highlight the Incoming Emails from Unknown Domains
- For a start, launch Outlook application.
- Then, trigger Outlook VBA editor according to “How to Run VBA Code in Your Outlook“.
- Next, copy the following VBA code into “ThisOutlookSession” project.
Public WithEvents objInbox As Outlook.Folder Public WithEvents objInboxItems As Outlook.Items Private Sub Application_Startup() Set objInbox = Outlook.Application.Session.GetDefaultFolder(olFolderInbox) Set objInboxItems = objInbox.Items End Sub Private Sub objInboxItems_ItemAdd(ByVal Item As Object) Dim objMail As Outlook.MailItem Dim objDomainProperty As Outlook.UserProperty Dim strSenderAddress, strSenderDomain As String If TypeOf Item Is MailItem Then Set objMail = Item Set objDomainProperty = objMail.UserProperties.Find("KnownDomain", True) If objDomainProperty Is Nothing Then Set objDomainProperty = objMail.UserProperties.Add("KnownDomain", olText, True) End If strSenderAddress = objMail.SenderEmailAddress strSenderDomain = Right(strSenderAddress, Len(strSenderAddress) - InStr(strSenderAddress, "@")) 'Change the specific domains If (strSenderDomain <> "datanumen.com") And (strSenderDomain <> "datanumen.net") Then objDomainProperty.Value = "No" Else objDomainProperty.Value = "Yes" End If objMail.Save End If End Sub
- After that, click into “Application_Startup” subroutine and press “F5”.
- Subsequently, exit VBA editor and open the Inbox folder.
- Next, turn to “View” tab and click “View Settings”.
- In the popup dialog box, click “Conditional Formatting” button.
- Then, in the next new dialog box, click “Add” and specify a name.
- Afterwards, click “Font” and choose a highlighting color.
- Later, click “Condition” tab.
- Next, switch to “Advanced” tab and add the criteria: “KnownDomain” > “s(exactly)” > “No”
- Finally, click several “OK” to save this conditional formatting rule.
- From now on, if a new email from the email address outside specific domains gets into Inbox, it will be highlighted in the specific color.
Keep Alert of All Harms to Outlook
There are lots of potential risks to your Outlook data file, including vulnerability, viruses, and human errors and so on. Therefore, you have to watch out for them all the time. For instance, you should never download suspicious attachments as well as keep exiting Outlook properly. Last but not least, it’s recommended to get hold of a robust and reliable PST repair tool, such as DataNumen Outlook Repair, which is able to restore damaged PST data with ease.
Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including SQL Server repair and outlook repair software products. For more information visit www.datanumen.com