Skip to main content

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

Author: Xiaoyang Last Modified: 2019-01-10

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
    xMailItem.Display
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


Best Office Productivity Tools

Breaking News: Kutools for Outlook Launches Free Version!

Experience the all-new Kutools for Outlook FREE version with 70+ incredible features, yours to use FOREVER! Click to download now!

๐Ÿค– Kutools AI : Instant pro emails with AI magic--one-click to genius replies, perfect tone, multilingual mastery. Transform emailing effortlessly! ...

๐Ÿ“ง Email Automation: Auto Reply (Available for POP and IMAP)  /  Schedule Send Emails  /  Auto CC/BCC by Rules When Sending Email  /  Auto Forward (Advanced Rules)   /  Auto Add Greeting   /  Automatically Split Multi-Recipient Emails into Individual Messages ...

๐Ÿ“จ Email Management: Recall Emails  /  Block Scam Emails by Subjects and Others  /  Delete Duplicate Emails  /  Advanced Search  /  Consolidate Folders ...

๐Ÿ“ Attachments ProBatch Save  /  Batch Detach  /  Batch Compress  /  Auto Save   /  Auto Detach  /  Auto Compress ...

๐ŸŒŸ Interface Magic: ๐Ÿ˜ŠMore Pretty and Cool Emojis   /  Remind you when important emails come  /  Minimize Outlook Instead of Closing ...

๐Ÿ‘ One-click Wonders: Reply All with Incoming Attachments  /   Anti-Phishing Emails  /  ๐Ÿ•˜Show Sender's Time Zone ...

๐Ÿ‘ฉ๐Ÿผโ€๐Ÿคโ€๐Ÿ‘ฉ๐Ÿป Contacts & Calendar: Batch Add Contacts From Selected Emails  /  Split a Contact Group to Individual Groups  /  Remove Birthday Reminders ...

Instantly unlock Kutools for Outlook with a single clickโ€”permanently free. Don't wait, download now and boost your efficiency!

kutools for outlook features1 kutools for outlook features2
 

 

 

Comments (1)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
did not work on my case i restarted i added 4 email address.
There are no comments posted here yet
Leave your comments
Posting as Guest
Rate this post:
0   Characters
Suggested Locations