Previous in Contents Next in Contents

Accessing an IProtocol Interface Object

You can access a specific IProtocol interface object by calling the Item method. Because IProtocols is a collection, you can access all IProtocol interface objects using a for each loop, as in the following example, where objProtocol is the name you give to the IProtocol interface object:

Option Explicit 
On Error Resume Next 

Dim objSearchAdmin, objBuildCatalog, objProtocol 

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

For Each objBuildCatalog in objSearchAdmin.BuildServer.BuildCatalogs 
  Wscript.Echo "Getting protocols for " & objBuildCatalog.Name

  For Each objProtocol in objBuildCatalog.Protocols
    If objProtocol.Included Then
      Wscript.Echo objProtocol.UrlName _
        & " protocol available for crawling using ProgID: " _
        & objProtocol.ProgIdHandler 
    Else
      Wscript.Echo objProtocol.UrlName _
        & " protocol not available for crawling"
    End If
  Next

  Wscript.Echo ""
Next

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

© 1997-2000 Microsoft Corporation. All rights reserved.