Software Developer's Kit - ChemDraw

Send comments on this topic
Data Property
See Also 
dataType
DataType defines a data type. A data type is an extension, a MIME type and a flag indicating whether it is valid.

Description

Member of ChemDrawCtl.

Sets and returns the data of the control.

Property type

Read-write property

Syntax

Visual Basic
Public Property Data( _
   Optional ByVal dataType As Variant _
) As Variant

Parameters

dataType
DataType defines a data type. A data type is an extension, a MIME type and a flag indicating whether it is valid.

Return Type

DataType

Example

 Dim strSMILES$
 'gets the content of the clipboard
 strSMILES= Clipboard.GetText
 strSMILES= Trim(strSMILES)
 If  strSMILES<> "" Then
     'clears the current content of the control
     ChemDrawCtl1.Objects.Clear
     
'pastes the string as structure
     ChemDrawCtl1.Data("chemical/x-smiles") = strSMILES
     'if the string was not recognized, the control is empty
     If  ChemDrawCtl1.Objects.Count = 0 Then
         'report error
         MsgBox "'" & strSMILES & "' is not recognized as a valid SMILES string.", _
         vbInformation
     End If
 End If

See Also