Accessing IStoplist Objects

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

Option Explicit 
On Error Resume Next 

Dim objSearchAdmin, objBuildServer, objCatalogs, objCatalog, objSchema, objStoplists, objStoplist 

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

For Each objCatalog in objCatalogs 
  Set objSchema    = objCatalog.objSchema 
  Set objStoplists = objSchema.objStoplists 

  Wscript.Echo "The schema For " & objCatalog.Name 
    & " has these stop lists:" 

  For Each objStoplist in objStoplists
    Wscript.Echo "  Name:        " & objStoplist.Name 
    Wscript.Echo "  Filename:    " & objStoplist.Filename 
    Wscript.Echo "  Language:    " & objStoplist.Language 
    Wscript.Echo "  SubLanguage: " & objStoplist.SubLanguage
    Wscript.Echo ""
  Next
  Wscript.Echo ""
Next

'Release objects 
Set objStoplist   = Nothing 
Set objStoplists  = Nothing 
Set objSchema     = Nothing 
Set objCatalog    = Nothing 
Set objCatalogs   = Nothing 
Set objBuildServer   = Nothing 
Set objSearchAdmin   = Nothing 
 

© 1997-1998 Microsoft Corporation. All rights reserved.