Share via


SnapIns::Item method

The Item method returns the SnapIn object at a specified index.

Syntax

SnapIns.Item( _
  ByVal Index As Long _
) As SnapIn

Parameters

Index

The index of the SnapIn being retrieved. The index is 1-based.

Examples

' Retrieve the count of SnapIn objects.
Dim nSnapIns As Long
nSnapIns = objSnapIns.Count
 
Dim i As Long
Dim objSnap As MMC20.SnapIn
' Iterate the SnapIn objects.
For i = 1 To nSnapIns
    ' Obtain the SnapIn
    Set objSnap = objSnapIns.Item(i)
    
    ' Use the SnapIn object.
    ' This example will display the SnapIn name.
    MsgBox (objSnap.Name)
    
    ' Free the SnapIn object for the next iteration.
    Set objSnap = Nothing
Next i

Requirements

Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
Header
Mmcobj.h
IDL
Mmcobj.idl
DLL
Mmcndmgr.dll
IID
IID_SnapIns is defined as 2EF3DE1D-B12A-49D1-92C5-0B00798768F1

See also

SnapIns.Count