Explorer.Search (Outlook)
Performs a Microsoft Instant Search on the current folder displayed in the Explorer using the given Query.
The functionality of Explorer.Search is analogous to the Search button in Instant Search. It behaves as if the user has typed the query string in the Instant Search user interface and then clicked Search. When calling Search, the query is run in the user interface, and there is no programmatic mechanism to obtain the search results. For more information on Instant Search, query for "Instant Search" in the Outlook Help. The Search method does not provide a callback to enable the developer to determine when the search is complete.
Search (Query, SearchScope)
Dim strQuery As String: strQuery =
ActiveExplorer.Search Query:=strQuery, SearchScope:=olSearchScopeAllFolders
Arguments
The following arguments are required:
Query (String) - A search string that can contain any valid keywords supported in Instant Search.
SearchScope (OlSearchScope) - Specifies the scope in terms of folders for the search.
Possible values are
olSearchScopeAllFolders | The search scope is across all folders that have the same folder type as the current folder (Folder.DefaultItemType), and all stores that have been selected for search. |
olSearchScopeAllOutlookItems | The search scope is all Outlook items in all folders in stores that have been selected for search. |
olSearchScopeCurrentFolder | The search scope is the folder represented by Explorer.CurrentFolder, and only that folder. |
olSearchScopeCurrentStore | The search scope is the store for the current folder, which contains the item displayed in the active explorer. |
olSearchScopeSubfolders | The search scope is the folder represented by Explorer.CurrentFolder and its subfolders. |