Share via


SearchFolders Interface 

A collection of ScopeFolder objects that determines which folders are searched when the Execute method of the FileSearch object is called.

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

Usage

Public Class earchFoldersImplementation
    Implements SearchFolders
End Class
Dim earchFoldersImplementation1 As New earchFoldersImplementation()

Syntax

Public Interface SearchFolders
    Inherits _IMsoDispObj, IEnumerable
public interface SearchFolders : _IMsoDispObj, IEnumerable
public interface class SearchFolders : public _IMsoDispObj, IEnumerable
public interface SearchFolders implements _IMsoDispObj, IEnumerable
public interface SearchFolders implements _IMsoDispObj, , IEnumerable

Remarks

Use the SearchFolders property with the FileSearch object to return the SearchFolders collection.

For each application there is only a single SearchFolders collection. The content of the collection remains after the code that calls it has finished executing. Consequently, it is important to clear the collection unless you want to include folders from previous searches in your search.

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, as there is only one SearchFolders collection for all searches.

The SearchFolders collection can be seen as a compliment to the LookIn property of the FileSearch object. Both specify the folders to search and both are used when the search is executed. However, if you only want to use the LookIn property, you should make sure that the SearchFolders collection is empty. Conversely, if you only want to use the SearchFolders collection, set the LookIn property to the path of the first member of the SearchFolders collection before you call the Execute method.

Platforms

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, and Windows 2000

Target Platforms

See Also

Reference

Microsoft.Office.Core Namespace

Other Resources

SearchFolders Members