Software Developer's Kit - ChemDraw

Send comments on this topic
CaptionJustification Property
See Also 


Member of ChemDraw Control.Settings

Sets and returns the justification used for captions

Property type

Read-write property


Visual Basic
Public Property CaptionJustification() As CDJustification

Return Type


Returns the justification for the caption (only four are available):

  • flush left: kCDJustificationLeft  (0)
  • centered: kCDJustificationCenter  (1)
  • flush right: kCDJustificationRight  (-1)
  • justified: kCDJustificationJustified  (2)

Another way to set the justification for a caption is using Caption.Justification.


'Declares variable vObject
 Dim vObject As ChemDrawControl10Ctl.Object
'Checks that there is an Object loaded the variable
 If  Selection.Object.Count < 1 Then
     Exit Sub
 End If

 Private Sub cmdSettings_click() 
    'Sets the Settings.CaptionJustification 
     Text1.Text = myObject.Settings.CaptionJustification
     vObject.Settings.CaptionJustification = kCDJustificationCenter 

    'Another way to set the justification to a caption 
     myCaption.Justification = kCDJustificationCenter 
     Text2.Text = myObject.Settings.CaptionJustification    
    'If object is a caption: 
     Text3.Text = myObject.Justification 
 End Sub

See Also