Software Developer's Kit - ChemDraw

Send comments on this topic
Item Method
See Also 
index

The location of an object in a collection, counted from the top, starting with 1.

Description

Member of ChemDraw Control.Groups

Given an index, returns one group from the groups collection.

Syntax

Visual Basic
Public Function Item( _
   ByVal index As Long _
) As Group

Parameters

index

The location of an object in a collection, counted from the top, starting with 1.

Example

'Groups.Item(1) 
 Dim MyGroup  As ChemDrawControl10Ctl.Group 
 Dim MyGroups As ChemDrawControl10Ctl.Groups  
 Set myGroups = ctlChemDraw.Selection.Objects.Groups

 Private Sub ctlChemDraw_SelectionChanged(ByVal selection As ChemDrawControl10Ctl.IChemDrawSelection)
     If  ctlChemDraw.Objects.Groups.Count = 1 Then 'checks if one Group has been drawn
         Set MyGroup = ctlChemDraw.Objects.Groups.Item(1)
     End If 
 End Sub

 Private Sub Command1_Click()
     vMessage = MsgBox("GroupType is: " & _
                MyGroups.Item(1).GroupType, vbInformation + vbOKOnly, "Info")
 End Sub


See Also