Software Developer's Kit - ChemDraw

Send comments on this topic
Caption Property
See Also 


Member of ChemDraw Control.ObjectTag.

Returns the text label (if any) associated with the ObjectTag.

Property type

Read-only property


Visual Basic
Public Property Caption() As Caption

Return Type


ObjectTag.Caption enables all the caption properties. By default, the property caption color of myObjectTag may be set to white. To see the caption, its color can be changed to blue, as follows:  myObjectTag.Caption.Color = vbBlue.

See also Caption.


'Shows example of caption property
 Dim myObjectTag as ChemDrawControl10Ctl.ObjectTag
 Dim myObject as ChemDrawControl10Ctl.Object
 Dim vName as string

 Private Sub Load_ObjectTag_Click()
    If  myObjectTag is Nothing Then
        vMessage = MsgBox(“No ObjectTag is loaded”, vbCritical + vbOKOnly, “Error”)
        vName = “Name_of_ObjectTag”
        ‘Makes an ObjectTag
        myObject.MakeObjectTag vName, myObjectTag, True
        ‘ObjectTag must be visible
        myObjectTag.Visible = True
        ‘Assigns the content of vString to the ObjectTag.StringValue 
        myObjectTag.StringValue = vString
        ‘With Persistent = False the ObjectTag will be saved when the file is saved
        myObjectTag.Persistent = False
        ‘Sets caption properties for the ObjectTag
        myObjectTag.Caption.Text = "This is an object XX"
        myObjectTag.Caption.Color = vbBlue
        myObjectTag.Caption.Angle = 90
        myObjectTag.Caption.Position.X = 100 
        myObjectTag.Caption.Position.Y = 100 
    End If
End Sub

See Also