OlSearchScope enumeration (Outlook)

Specifies the scope in terms of folders for the search.

Name Value Description
olSearchScopeAllFolders 1 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 2 The search scope is all Outlook items in all folders in stores that have been selected for search.
olSearchScopeCurrentFolder 0 The search scope is the folder represented by Explorer.CurrentFolder, and only that folder.
olSearchScopeCurrentStore 4 The search scope is the store for the current folder, which contains the item displayed in the active explorer.
olSearchScopeSubfolders 3 The search scope is the folder represented by Explorer.CurrentFolder and its subfolders.

Remarks

You can select stores to search in the Locations to Search menu by clicking Search Tools in the Options group of the Search contextual tab in the Microsoft Office Fluent ribbon.

By default, search does not include the Deleted Items folder. To search the Deleted Items folder, set that folder as your current folder and search by olSearchScopeCurrentFolder.

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.