Creating an IServer Object

You create an IServer object by calling the IServers.Add method, as in the following example, where objServer is the name you give to the IServer object:

Option Explicit 
On Error Resume Next 

Dim objSearchAdmin, objBuildServer, objCatalogs, objCatalog, objServers, objServer 

Set objSearchAdmin = CreateObject("Search.SearchAdmin.1") 
Set objBuildServer = objSearchAdmin.BuildServer 
Set objCatalogs = objBuildServer.BuildCatalogs 
Set objCatalog  = objCatalogs("KMSampleCatalog1") 
Set objServers  = objCatalog.Sites 

Set objServer   = objServers.Add("Microsoft.com") 

... 

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

© 1997-1998 Microsoft Corporation. All rights reserved.