Table Suite
526
If you want to sort paragraphs within a table cell, include only the paragraphs and not the end-of-
cell mark; if you include the end-of-cell mark in a selection or range and then attempt to sort the
paragraphs, Word displays a message stating that it found no valid records to sort.
Example
This example creates a tab-separated list in a new document, converts the list to a table, and then
sorts the table in descending alphanumeric order.
set newDoc to make new document
set content of text object of newDoc to "1" & tab & "Pear" & return & "2" & ¬
tab & "Zucchini" & return & "3" & tab & "Apple" & return
set tableText to text object of newDoc
convert to table tableText separator separate by tabs
table sort table 1 of newDoc sort order sort order descending
Command: update auto format
Updates the table with the characteristics of a predefined table format. For example, if you apply a
table format with AutoFormat and then insert rows and columns, the table may no longer match the
predefined look. The update auto format command restores the format.
Syntax
update auto format table Required. An expression that returns a table object.
Example
This example creates a table, applies a predefined format to it, adds a row, and then reapplies the
predefined format.
set newDoc to make new document
set myTable to make new table at the beginning of newDoc with properties ¬
{number of columns:5, number of rows:5}
auto format table myTable table format table format columns1
insert rows selection position above number of rows 1
display dialog "Click OK to reapply autoformatting."
update auto format myTable
This example restores the predefined format to the table that contains the insertion point.
set isInTable to get selection information selection ¬
information type with in table
if isInTable is "true" then
update auto format table 1 of selection
else
display dialog "The insertion point is not in a table."
end if