Accessing ISitePath Objects

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

Option Explicit 
On Error Resume Next 

Dim objSearchAdmin, objBuildServer, objCatalogs, objCatalog, objSites, objSite, objPaths, objPath 

Set objSearchAdmin = CreateObject("Search.SearchAdmin.1") 
Set objBuildServer = objSearchAdmin.BuildServer 
Set objCatalogs = objBuildServer.BuildCatalogs 
Set objCatalog  = objCatalogs("KMSampleCatalog1")
Set objSites    = objCatalog.objSites
Set objSite     = objSites.Item("Microsoft.com")
Set objPaths    = objSite.objPaths

For Each objPath in objPaths
  ...
Next

'Release objects 
Set objPath    = Nothing 
Set objPaths    = Nothing 
Set objSite     = Nothing 
Set objSites    = Nothing 
Set objCatalog  = Nothing 
Set objCatalogs = Nothing 
Set objBuildServer = Nothing 
Set objSearchAdmin = Nothing 
 

© 1997-1998 Microsoft Corporation. All rights reserved.