Software Developer's Kit - ChemDraw

Send comments on this topic
Tables Property
See Also 

Description

Member of ChemDraw Control.AltGroup.

Returns the tables in this AltGroup.

Property type

Read-only property

Syntax

Visual Basic
Public Property Tables() As Tables

Return Type

Remarks

The tables property refers to the collection of tables which is within this AltGroup. The members of this collection will be the tables in this AltGroup. The properties associated with the collection are the following:

myAltGroup.Tables.Application      returns the application associated with the tables collection
myAltGroup.Tables.Count             returns the number of tables in the collection
myAltGroup.Tables.Item(i)           returns one table from the collection
myAltGroup.Tables.Parent            returns the parent of the tables collection

With AltGroup.Tables.Item(i) all the table properties are enabled for table(i). This index starts with 1.

Example

'Returns the number of tables from the collection of tables in this AltGroup  
 Dim MyAltGroup As ChemDrawControl10Ctl.AltGroup
 Private Sub ChemDrawControl10Ctl_SelectionChanged(ByVal selection As ChemDrawControl10Ctl.IChemDrawSelection)
     If  ChemDrawControl10Ctl.Objects.AltGroups.Count = 1 Then 'Checks if an AltGroup has been drawn
         Set MyAltGroup = ChemDrawControl10Ctl.Objects.AltGroups.Item(1)
         Command1.Enabled = True
     Else
         Command1.Enabled = False
     End If
 End Sub

 Private Sub Command1_Click()
     vMessage = MsgBox("The number of Tables is: " & MyAltGroup.Tables.Count, vbInformation + vbOKOnly, "Info")
 End Sub


See Also