IixssoUtil::AddScopeToQuery method

[Indexing Service is no longer supported as of Windows XP and is unavailable for use as of Windows 8. Instead, use Windows Search for client side search and Microsoft Search Server Express for server side search.]

Adds a search path to the Query property of the Query object.

Do not confuse this with IScopeAdm, which is the Indexing Service administration object that defines the paths to index.


HRESULT AddScopeToQuery(
  [in]           IDispatch *pDisp,
  [in]           BSTR      pwszScope,
  [in, optional] BSTR      pwszDepth


pDisp [in]

The Query object using this scope.

pwszScope [in]

The physical or virtual path of the scope to be added.

pwszDepth [in, optional]

Indicates whether the scope covers only the named directory ("shallow") or the named directory and all its subdirectories ("deep").

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.


When you first create an instance of the Query object or when you reset it, Query defaults to the entire catalog. The first time you call AddScopeToQuery, the specified scope replaces the default value. Subsequent calls to AddScopeToQuery append the additional scopes to a collection of scopes.


Minimum supported client
Windows 2000 Professional [desktop apps only]
Minimum supported server
Windows 2000 Server [desktop apps only]
End of client support
Windows 7
End of server support
Windows Server 2008 R2

See also