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

Default member of ChemDraw Control.Cells

Given an index, returns one cell from the cells collection.

Syntax

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

Parameters

index

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

Return Type

Remarks

Working with this property, allows referencing any given cell of a collection of cells, and all the cell properties are available.

MyCells.Item(i).BottomBorder.Color      sets and returns the bottom border color of the cell
MyCells.Item(i).Bonds                          returns the collection of bonds in this cell

Example

'Declares variables 
 Dim myCells As ChemDrawControl11Ctl.Cells
 Set myCells = ctlChemDraw.Selection.Objects.Cells

 Private Sub cmdCells_Click()
    'returns the application of the cells collection
     Text1.text = MyCells.Application
    'returns the number of cells in the cells collection
     Text2.text = MyCells.Count 
    'sets the Item(1) of the cells collection 
     myCells.Item(1).Border.Color = VBRed
    'returns atoms collection of Item(1)of the cells collection 
     Text3.text = MyCells.Item(1).Atoms
 End Sub

See Also