Item Property

This read-only property accesses an extension (IExtension interface).

Syntax

IExtensions[.Item(Extension)]

Parameters

Extension

The extension to access.

Remarks

Since IExtensions is a collection, you need only include Item to access an IExtension object by name (see the following Example).

Example

The following example displays whether the PDF extension is included for all catalog definitions.

Option Explicit 
On Error Resume Next 

Dim objSearchAdmin, objBuildServer, objCatalogs, objCatalog
Dim objExtensions, objExtension, Ext, ExInclude 

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

For Each objCatalog in objCatalogs 
    Set objExtensions = objCatalog.objExtensions 
    Set Ext = objExtensions.Item("PDF")

    If IsEmpty(Ext) = False Then 
        If Ext.IncludedExtension Then
            Wscript.Echo objCatalog.Name & " includes the PDF extension." 
        Else
            Wscript.Echo objCatalog.Name & " excludes the PDF extension." 
        End If 
    End If

Next 

'Release objects 
Set Ext        = Nothing 
Set objExtension  = Nothing 
Set objExtensions = Nothing 
Set objCatalog    = Nothing 
Set objCatalogs   = Nothing 
Set objBuildServer   = Nothing 
Set objSearchAdmin   = Nothing 
 

See Also

Count


© 1997-1998 Microsoft Corporation. All rights reserved.