Software Developer's Kit - ChemDraw

Send comments on this topic
ObjectTagType Property
See Also 

Description

Member of ChemDraw Control.ObjectTag.

Returns the type of the ObjectTag.

Property type

Read-only property

Syntax

Visual Basic
Public Property ObjectTagType() As CDObjectTagType

Return Type

Remarks

Returns the type of the object tag. The type of the tag is the type of the data which was stored in the tag when it was created. The options are enumerated as CDObjectTagType

Example

'Example - ObjectTag 
'object can be any ChemDraw object 
 Dim vObjectTag As ChemDrawControl10Ctl.ObjectTag
 Dim myObject As ChemDrawControl10Ctl.Object
 Dim vName As String
'------------------------------------------------------------
 Private Sub cmdMake_Click()
    vName = "NewName"
    Dim vAux As String
    vAux = "Value of Object Tag"
    Set vObjectTag = Nothing
    'creates the object tag
    MyObject.MakeObjectTag vName, vObjectTag, True
    vObjectTag.StringValue = vAux
    If  (Not vObjectTag Is Nothing) Then
        'gets the object tag but it must be visible to see
        MyObject.GetObjectTag vName
        vObjectTag.Visible = True
        'ObjectTagType: returns the type content of the ObjectTag
        Select Case MyObject.GetObjectTag(vName).ObjectTagType
               Case Is = kCDObjectTagTypeUndefined '0
                    'undefined value is True 
               Case Is = kCDObjectTagTypeDouble '1
                    'DoubleValue is True
                    TextValue.Text = MyObject.GetObjectTag(vName).DoubleValue
               Case Is = kCDObjectTagTypeLong '2
                    'LongValue is True
                    TextValue.Text = MyObject.GetObjectTag(vName).LongValue
               Case Is = kCDObjectTagTypeString '3
                    'String.Value is True
                    TextValue.Text = MyObject.GetObjectTag(vName).StringValue
        End Select
    End If
End Sub

See Also