Previous in Contents Next in Contents

Creating and Accessing IStoplist Interface Objects

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

Option Explicit 
On Error Resume Next 

Dim objSearchAdmin, objBuildCatalog, objStoplist 

Set objSearchAdmin = CreateObject("Search.SearchAdmin.1") 

Set objBuildCatalog    = _ 
  objSearchAdmin.BuildServer.BuildCatalogs("KMSampleCatalog1") 

objBuildCatalog.Schema.Stoplists.Add "English_Digits", "noise.end", 9, 9 

For Each objBuildCatalog in objSearchAdmin.BuildServer.BuildCatalogs 
  Wscript.Echo "The schema For " & objBuildCatalog.Name _
    & " has these stop lists:" 

  For Each objStoplist in objBuildCatalog.Schema.Stoplists
    Wscript.Echo "  Name:           " & objStoplist.Name 
    Wscript.Echo "  Filename:       " & objStoplist.Filename 
    Wscript.Echo "  Language ID:    " & objStoplist.Language 
    Wscript.Echo "  SubLanguage ID: " & objStoplist.SubLanguage
    Wscript.Echo ""
  Next
  Wscript.Echo ""
Next

'Release objects 
Set objStoplist   = Nothing 
Set objBuildCatalog    = Nothing 
Set objSearchAdmin   = Nothing 
 

© 1997-2000 Microsoft Corporation. All rights reserved.