Accessing ISiteRestriction Objects

You access an ISiteRestriction object by calling the ISiteRestrictions.Item property. Since ISiteRestrictions is a collection, you can access all ISiteRestriction objects using a for each loop, as in the following example, where objSite is the name you give to the ISiteRestriction object:

Option Explicit 
On Error Resume Next 

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

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

For Each objSite in objSites
  ...
Next

'Release objects 
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.