Table Suite
515
This example creates a 3x3 table in a new document and then changes the width of all the columns
to accommodate the width of the text.
set newDoc to make new document
set myTable to make new table at the beginning of newDoc with properties ¬
{number of rows:3, number of columns:3}
set content of text object of cell 1 of row 1 of myTable to "First cell"
set content of text object of cell 2 of row 1 of myTable to "This is cell (1,2)"
set content of text object of cell 3 of row 1 of myTable to "(1,3)"
auto fit every column of myTable
Command: auto fit behavior
Determines how Word resizes a table when the AutoFit feature is used. Word can resize the table
based on the content of the table cells or the width of the document window. You can also use this
command to turn off AutoFit so that the table size is fixed, regardless of cell contents or window
width.
Syntax
auto fit behavior table Required. An expression that returns a table object.
behavior enumeration Required. How Word resizes the specified table when the AutoFit
feature is used. Can be one of the following: auto fit content, auto fit fixed, or auto fit
window.
Setting the behavior to auto fit content or auto fit window sets the allow auto fit property to true if
it's currently false. Likewise, setting the behavior to auto fit fixed sets the allow auto fit property to
false if it's currently true.
Example
This example sets the AutoFit behavior for the first table in the active document to automatically
resize based on the width of the document window.
set myTable to table 1 of active document
auto fit behavior myTable behavior auto fit window
Command: auto format table
Applies a predefined look to a table. The arguments for this command correspond to the options in
the Table AutoFormat dialog box (Table menu).
Syntax
auto format table table Required. An expression that returns a table object.
[table format enumeration] Optional. The predefined table format. Can be any one of the auto
format table type properties constants. The default value is table format simple1.
[apply borders Boolean] Optional. True to apply the border properties of the specified format.
The default value is true.
[apply shading Boolean] Optional. True to apply the shading properties of the specified format.
The default value is true.