In order to check the unreplied emails more easily in your Outlook, you can create a search folder for such emails. Now, this article will introduce you how to get it with Outlook VBA.
In the previous article “How to Auto Highlight the Important Emails You Haven’t Replied in Outlook”, you can learn a means to show the vital emails you haven’t replied in a specific color. But, you may feel it still troublesome in that you have to look through all mail folders one by one. Hence, you would like to directly collect all such emails in a search folder. Now, in the followings, we will teach you to use VBA to quickly create such a search folder.
Create a Search Folder for All Unreplied Emails
- At the very outset, start Outlook application.
- Then, press “Alt + F11” keys to access VBA editor.
- Next, copy the following VBA code into a module that is not in use.
Sub CreateSearchFolder_AllNotRepliedEmails() Dim strScope As String Dim strRepliedProperty As String Dim strFilter As String Dim objSearch As Outlook.Search 'Specify the folders to be searched 'Here we use Inbox folder for an example strScope = "'" & Application.Session.GetDefaultFolder(olFolderInbox).FolderPath & "'" 'Search filter strRepliedProperty = "http://schemas.microsoft.com/mapi/proptag/0x10810003" strFilter = Chr(34) & strRepliedProperty & Chr(34) & " <> 102" & "AND" & Chr(34) & strRepliedProperty & Chr(34) & " <> 103" Set objSearch = Outlook.Application.AdvancedSearch(Scope:=strScope, Filter:=strFilter, SearchSubFolders:=True, Tag:="SearchFolder") 'Save the search folder objSearch.Save ("Not Replied Emails") MsgBox "Search folder is created successfully!", vbInformation + vbOKOnly, "Search Folder" End Sub
- Subsequently, put cursor in this subroutine.
- After that, click “F5” key button to trigger this macro.
- When macro finishes, a message, like the following figure, will display.
- Finally, you can see a new search folder called “Not Replied Emails”, which contains all the unreplied emails in Inbox.
Change Search Scope of the Search Folder
In my VBA code, this search folder only searches the default Inbox folder. If you want to change the search scope, you can follow the steps below.
- First off, right click the search folder.
- Then, choose “Customize This Search Folder” from the context menu.
- Next, in the popup “Custom Search Folder” dialog, click “Browse” button.
- Later, a new dialog box of “Select Folder(s)” will display. In it, you can choose the folders to be searched for emails you haven’t replied.
- Finally, after selecting, you can just click several “OK” to apply the changes.
Eliminate Frequent Outlook Errors
It is common to receive error messages in your Outlook, such as errors related to sending/receiving failures, errors involving inaccessible Outlook PST file and so on. Therefore, so as to deal with these errors quickly and effectively, you have to learn how to locate and make use of the inbox repair tool. Besides, in case of the inbuilt tool failure, it is suggested to get hold of another excellent external utility, such as DataNumen Outlook Repair.
Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including SQL Server repair and outlook repair software products. For more information visit www.datanumen.com