Accessing ISearchCatalog Objects

You access a specific ISearchCatalog object by calling the ISearchCatalogs.Item property. Since ISearchCatalogs is a collection, you can access all ISearchCatalog objects using a for each loop, as in the following example, where objCatalog is the name you give to the ISearchCatalog object:

Option Explicit 
On Error Resume Next

Dim objSearchAdmin, objSearchServer, objCatalogs, objCatalog 

Set objSearchAdmin  = CreateObject("Search.SearchAdmin.1")
Set objSearchServer = objSearchAdmin.SearchServer
Set objCatalogs  = objSearchServer.SearchCatalogs 

For Each objCatalog in objCatalogs
  ...
Next

'Release objects 
Set objCatalog   = Nothing 
Set objCatalogs  = Nothing 
Set objSearchServer = Nothing
Set objSearchAdmin  = Nothing 
 

© 1997-1998 Microsoft Corporation. All rights reserved.