Software Developer's Kit - ChemDraw

Send comments on this topic
Styles Collection
See Also  Members 


Member of ChemDraw Control.

For a list of all members defined for this collection, see Styles Members.

ChemDraw Styles Collection contains all of the style objects in the document.

Object Model


Styles is a collection containing all of the style objects in the ChemDraw document. If myStyles is a styles collection object:

MyStyles.Application   returns the application associated with the Styles collection
MyStyles.Count          returns the number of Styles in the collection
MyStyles.Item(i)        given an index, references one Style in particular
MyStyles.Parent         returns the parent of the Styles collection

Using myStyles.Item(i) all the style properties are enabled for myStyles(i). This index starts with 1.


'Declares variables 
 Dim myStyles As ChemDrawControl11Ctl.Styles
 Set myStyles = ctlChemDraw.Selection.Objects.Styles

 Private Sub cmdStyles_Click()
    'returns the application of the Styles collection
     Text1.text = MyStyles.Application
    'returns the number of Styles in the Styles collection
     Text2.text = MyStyles.Count 
    'sets the Item(1) of the Styles collection 
     myStyles.Item(1).Face = kCDFontStyleBold
 End Sub

See Also