Accessing IBuildCatalog Objects

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

Option Explicit 
On Error Resume Next

Dim objSearchAdmin, objBuildServer, objCatalogs, objCatalog 

Set objSearchAdmin = CreateObject("Search.SearchAdmin.1")
Set objBuildServer = objSearchAdmin.BuildServer
Set objCatalogs    = objBuildServer.BuildCatalogs 

For Each objCatalog in objCatalogs
  ...
Next

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

© 1997-1998 Microsoft Corporation. All rights reserved.