편집

다음을 통해 공유


SearchFolders Interface

Definition

A collection of ScopeFolder objects that determines which folders are searched when the Execute(MsoSortBy, MsoSortOrder, Boolean) method of the FileSearch object is called.

public interface class SearchFolders : Microsoft::Office::Core::_IMsoDispObj, System::Collections::IEnumerable
[System.Runtime.InteropServices.Guid("000C036A-0000-0000-C000-000000000046")]
public interface SearchFolders : Microsoft.Office.Core._IMsoDispObj, System.Collections.IEnumerable
[<System.Runtime.InteropServices.Guid("000C036A-0000-0000-C000-000000000046")>]
type SearchFolders = interface
    interface _IMsoDispObj
    interface IEnumerable
Public Interface SearchFolders
Implements _IMsoDispObj, IEnumerable
Attributes
Implements

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(ScopeFolder) 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.

Properties

Application

Returns an Application object that represents the container application for the object.

Count

Returns an Integer indicating the number of items in the specified collection.

Creator

Returns a 32-bit integer that indicates the application in which the specified object was created.

Item[Int32]

Returns a ScopeFolder object that represents a subfolder of the parent object.

Methods

Add(ScopeFolder)

Adds a search folder to a file search.

GetEnumerator()
Remove(Int32)

Removes the specified object from the collection.

Applies to