Skip to main content

 How to open all unread emails in Outlook?

Author: Xiaoyang Last Modified: 2018-05-03

If there are multiple unread email messages in your Inbox of the Outlook, how could you open all of them to read at once as quickly as you can?

Open all unread email messages in a specific Inbox or other folder with VBA code

Open all unread email messages in a specific Inbox or other folder with VBA code

The following VBA code can help you to open all unread email messages in your Inbox or other specific folder at once, please do with below steps:

1. First, you should select a folder which you want to open all unread emails from.

doc open all unread eamils 1

2. Then hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.

3. And then, click Insert > Module, copy and paste below code into the opened blank module, see screenshot:

VBA code: Open all unread email messages in specific folder:

Sub OpenAllUnreadEmails()
Dim xFolders As Outlook.Folders
Dim xFolder As Outlook.Folder
Dim xUnreadEmailCount As Long
On Error Resume Next
xUnreadEmailCount = 0
Set xFolders = Application.ActiveExplorer.CurrentFolder.Folders
Call OperatingFolders(Application.ActiveExplorer.CurrentFolder, xUnreadEmailCount)
For Each xFolder In xFolders
    Call OperatingFolders(xFolder, xUnreadEmailCount)
Next
MsgBox "Open " & xUnreadEmailCount & " unread emails successfully!", vbExclamation + vbOKOnly, "Kutools for Outlook"
End Sub
Sub OperatingFolders(ByVal xCurrentFld As Outlook.Folder, UnreadEmailCount As Long)
Dim xItem As Object
Dim xMailItem As Outlook.MailItem
Dim xSubFolder As Outlook.Folder
On Error Resume Next
If xCurrentFld.DefaultItemType = olMailItem Then
    For Each xItem In xCurrentFld.Items
        If xItem.Class = olMail Then
            Set xMailItem = xItem
            If xMailItem.UnRead = True Then
                xMailItem.Display
                UnreadEmailCount = UnreadEmailCount + 1
            End If
        End If
    Next
End If
If xCurrentFld.Folders.Count > 0 Then
    For Each xSubFolder In xCurrentFld.Folders
        Call OperatingFolders(xSubFolder, UnreadEmailCount)
    Next
End If
End Sub

doc open all unread eamils 2

4. And then, press F5 key to run this code, and all unread emails will be opened in the specified folder at once, at last, a prompt box will pop out to remind the number of unread emails which are opened, see screenshot:

doc open all unread eamils 3

Note: This code is not available for meeting emails.


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
my mails not opening .since 10days. please help me sir.
There are no comments posted here yet
Leave your comments
Posting as Guest
Rate this post:
0   Characters
Suggested Locations