Skip to main content

 How to create a search folder for all un-replied emails in Outlook?

Author: Xiaoyang Last Modified: 2024-08-21

If you want to check the un-replied emails in your Outlook, to search them one by one will take much time. This article, I will talk about creating a search folder for all un-replied messages.

Create a search folder for all un-replied emails in Outlook with VBA code


Create a search folder for all un-replied emails in Outlook with VBA code

The following VBA code can help you to create a search folder where will put all un-replied emails, please do as this:

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

2. Click Insert > Module, and paste the following macro in the Module Window.

VBA code: Create a search folder for un-replied emails:

Sub CreateSearchFolder_AllNotRepliedEmails()
    Dim xSearch As Outlook.Search
    Dim xScope As String, xFilter As String
    Dim xRepliedProperty As String
    Dim xFolder As Folder, xSubFolder As Folder
    On Error Resume Next
    xScope = ""
    For Each xFolder In Outlook.Application.Session.Folders
        Set xSubFolder = xFolder.Folders("Inbox")
        xScope = "'" + xSubFolder.FolderPath + "'"
        xRepliedProperty = "http://schemas.microsoft.com/mapi/proptag/0x10810003"
        xFilter = Chr(34) & xRepliedProperty & Chr(34) & " <> 102" & "AND" & Chr(34) & xRepliedProperty & Chr(34) & " <> 103"
        Set xSearch = Outlook.Application.AdvancedSearch(Scope:=xScope, Filter:=xFilter, SearchSubFolders:=True, Tag:="SearchFolder")
        xSearch.Save("Not Replied Emails").ShowItemCount = olShowTotalItemCount
        Set xSearch = Nothing
        Set xSubFolder = Nothing
    Next
    MsgBox "Search folder is created successfully!", vbInformation + vbOKOnly, "Kutools for Outlook"
End Sub

3. Then, press F5 key to run this code, and a prompt box is popped out as following screenshot shown:

doc search folder for unreplied 1

4. Click OK button, now, you will get a Not Replied Emails folder under the Search Folders for each account in your Outlook, and all un-replied emails are displayed here, see screenshot:

doc search folder for unreplied 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 : Uses advanced AI technology to handle emails effortlessly, including replying, summarizing, optimizing, extending, translating, and composing emails.

πŸ“§ 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 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 ...

Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

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

kutools for outlook features1 kutools for outlook features2