Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in


How to open all incoming emails from a specific person automatically in Outlook? 

In our daily work, maybe there are many emails arriving in our Outlook, in this case, you may ignore some important emails from a specific person. To avoid missing some important emails from someone, you can make the emails open automatically when arriving into your Outlook. In this article, I will introduce a VBA code for opening all emails which from a specific sender.

Open all incoming emails form a specific person automatically with VBA code

Open all incoming emails form a specific person automatically with VBA code

To automatically open the emails from a specific person, the following VBA code can help you, please do as this:

1. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.

2. In the Microsoft Visual Basic for Applications window, double click ThisOutlookSession from the Project1(VbaProject.OTM) pane to open the mode, and then copy and paste the following code into the blank module.

VBA code: Auto open all emails from a specific person:

Public WithEvents GInboxFolder As Outlook.Folder
Public WithEvents GInboxItems As Outlook.Items
Private Sub Application_Startup()
    Set GInboxFolder = Outlook.Application.Session.GetDefaultFolder(olFolderInbox)
    Set GInboxItems = GInboxFolder.Items
End Sub
Private Sub GInboxItems_ItemAdd(ByVal Item As Object)
    Dim xMailItem As Outlook.MailItem
    Dim xSenders As String
    On Error Resume Next
    If Item.Class <> olMail Then Exit Sub
    Set xMailItem = Item
    xSenders = "yy@addin99.com;applemiemie@163.com"
    If InStr(xSenders, xMailItem.SenderEmailAddress) = 0 Then Exit Sub
End Sub

doc open emails by sender 1

Note: In the above code, you can change the addresses of the senders to your own.

3. Then, save and close this code window. Restart the Outlook to make the code take effect, from now on, when the emails arriving from the persons you specified, all of them will be open automatically. See screenshot:

doc open emails by sender 2

Recommended Productivity Tools

shot kutools outlook kutools tab 1180x121
shot kutools outlook kutools plus tab 1180x121

Kutools for Outlook - More than 100 Advanced Functions for Outlook, Improve 70% Efficiency For you

  • Complicated and repeated operations can be done a one-time processing in seconds.
  • Forward multiple emails individually with one-click, and auto forward by rules.
  • Auto CC/BCC every sending email and easy for customizing rules, and auto reply without requiring exchange server.
  • Powerful junk emails filter, remove duplicate emails, reply with attachment, bunch of one-click operations, and so on...
  • 60-day unlimited free trial. 60-day money back guarantee. 2 years free upgrade and support. Buy once, use forever.
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.

Be the first to comment.