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

Given an index, returns one caption from the captions collection.

Syntax

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

Parameters

index

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

Return Type

Remarks

The property Item, followed by an index allows referencing one Caption in particular from the Captions collection, which are the Captions present in the ChemDraw document. This enables all the Caption properties.

Example

'Declares variables 
 Dim myCaptions As ChemDrawControl11Ctl.Captions
 
Set
myCaptions = ctlChemDraw.Selection.Objects.Captions

 Private Sub cmdCaptions_Click()
    'returns the application of the Captions collection
     
Text1.text = MyCaptions.Application 
    'returns the number of Captions in the Captions collection
     Text2.text = MyCaptions.Count
    'sets the Item(1) of the Captions collection   
     
myCaptions.Item(1).CaptionFace = 2
    'returns the face  of the caption 
     Text3.text = MyCaptions.Item(1).CaptionFace
 End Sub

See Also