ScopeFolder Interface

Corresponds to a searchable folder.

Namespace:  Microsoft.Office.Core
Assembly:  office (in office.dll)

public interface ScopeFolder : _IMsoDispObj

ScopeFolder objects are intended for use with the SearchFolders collection. The SearchFolders collection defines the folders that are searched when using the FileSearch object. When you want to search specific folders, you can use the methods and properties of the SearchScope object and the ScopeFolders collection to retrieve ScopeFolder objects and add them to the SearchFolders collection.

Use the ScopeFolder property of the SearchScope object to return the root ScopeFolder object of a search scope.

Use the Item method of the ScopeFolders collection to return a subfolder of a root ScopeFolder object, or a folder that will be searched the next time the Execute method of the FileSearch object is called.

In each ScopeFolder object there is a ScopeFolders collection that contains the subfolders of the parent ScopeFolder object. You can traverse the entire folder structure of a search scope (for example, all local drives) by looping through these ScopeFolders collections and returning all of the lower-level ScopeFolder objects. A ScopeFolder object with no subfolders contains an empty ScopeFolders collection.

You can use the Add method of the SearchFolders collection to add a ScopeFolder object to the SearchFolders collection; however, it is usually simpler to use the AddToSearchFolders method of the ScopeFolder that you want to add, because there is only one SearchFolders collection for all searches.