Cookies help us deliver our services. By using our services, you agree to our use of cookies.
Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in


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

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 = ""
        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
    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

Kutools for Outlook

More than 100 Advanced Functions for Outlook 2010, 2013, 2016, 2019 and 365

screen shot kutools for outlook tiny for banner 201812

More Features  |  Free Download  |  Only $39.00 for hundreds of functions

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.