Поделиться через


SnapIns::Add method

The Add method adds a snap-in to the collection. The snap-in being added must be referenced by its name, CLSID, or ProgID.

Syntax

SnapIns.Add( _
  ByVal SnapinNameOrCLSID As String, _
  ByVal ParentSnapin As Variant, _
  ByVal Properties As Variant _
) As SnapIn

Parameters

SnapinNameOrCLSID

The name, CLSID, or ProgID for the registered snap-in being added to the collection.

ParentSnapin

Optional SnapIn object under which the new SnapIn object is added.

Properties

Optional properties to be used by the snap-in. The snap-in must implement the ISnapinProperties interface for the Properties parameter to be useful. The Properties parameter can be created by the Document.CreateProperties method.

Examples

Dim objSnap As MMC20.SnapIn
' Add the "Folder" snap-in.
' Optional parameters for SnapIns.Add are not used.
Set objSnap = objSnapIns.Add("Folder")
 
' Use the SnapIn object.
' ...
 
' Free the SnapIn object when done.
Set objSnap = Nothing

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.Remove

Application.OnSnapInAdded

ISnapinProperties

Document.CreateProperties