The TableRow object provides control over attributes of a tabulation row, i.e. all the attributes that can be modified using the EditTableRowDlg command.
Creating a TableRow object
TableRow object can be obtained from a text being edited using the GetTableRow function, e.g:
Dim objTableRow = Text.GetTableRow
note that the cursor should be positioned inside an editable table for this method to work.
Getting and setting properties
A TableRow object has a number of properties, each one corresponding to a row attribute. Each one of these properties can be set - modifying the corresponding attribute - or queried - returning the value of the corresponding attribute.
When setting values, remember that you have to call explicitly the SetTableRow command suppying modified object, e.g.
Text.SetTableRow (objTableRow)
When querying values, remember that these properties can also be 'without value'. This happens when the corresponding attribute has not been set, or it has multiple values, or it has been explicitely chosen as 'don't change' in a dialog.
Attempts to query the value of a property that does not have a value causes a run-time error during the execution of the script.
For each one of the properties there is a boolean function that specifies if the corresponding property has a value. The name of these boolean functions is the same of the properties prefixed with 'Has', so the RuleColor property holds the color of the rule and the HasRuleColor function returns true if RuleColor has a value.
In the case of the object obtained from a text using the GetTableRow function, each attribute property has a value either if the text has no selection, or if the correponding attribute has the same value in all the rows containing selected text.
The values that are assigned to attribute properties are validated: attempts to assign invalid values causes run-time errors.
Resetting local properties
To reset local properties for the current row and let them be overridden by table properties, use Text.RemoveTableRowProp 0 or Text.RemoveTableRowProp 1 (parameter 0 means do not modify joined cells - if any, and 1 means do modify also joined cells).
To reset local properties of entire table and let them be overridden by table properties, use Text.RemoveTableProp 0 or Text.RemoveTableProp 1 (parameter 0 means do not modify joined cells - if any, and 1 means do modify also joined cells).