Software Developer's Kit - ChemDraw

Send comments on this topic
selection Property
See Also 

Description

Member of ChemDraw Control.Document.

Returns the selection of the document.

Property type

Read-only property

Syntax

Visual Basic
Public Property selection() As selection

Return Type

Remarks

Returns the selection of the document

Example

'Declares variables
 Dim myDoc As ChemDrawControl10Ctl.Document
 Dim myApp As ChemDrawControl10Ctl.Application
 Set myApp = ctlChemDraw.Application
 Set myDoc = myApp.ActiveDocument

 Private Sub ctlChemDraw_SelectionChanged(ByVal selection As _
     ChemDrawControl10Ctl.IChemDrawSelection)
    'Loads an object into the variable
     If  selection.objects.Count = 1  Then  
         Set  myObject = myDoc.selection.Objects.Item(1)
         Label1.Caption = "Object" 
     End If
 End Sub

See Also