Text Suite
449
Example
This example collapses the selection to an insertion point at the beginning of the previous selection.
collapse range text object of selection direction collapse start
This example sets
myRange
equal to the contents of the active document, collapses
myRange
, and
then inserts a 2x2 table at the end of the document.
set myRange to text object of active document
set myRange to collapse range myRange direction collapse end
make new table at active document with properties {number of rows:2, ¬
number of columns:2}
Command: compute statistics
Returns a statistic based on the contents of the specified text range.
Syntax
compute statistics text range Required. An expression that returns a text range object.
[statistic enumeration] Required. The statistic. Can be one of the following: statistic words,
statistic lines, statistic pages, statistic characters, statistic paragraphs, statistic characters
with spaces, or statistic east asian characters.
Command: convert to table
Converts text within a range or selection to a table. Returns the table as a table object.
Syntax
convert to table text range Required. An expression that returns a text range object.
[separator enumeration] Optional. Specifies the character used to separate text into cells. Can be
a character or one of the following: separate by paragraphs, separate by tabs, separate by
commas, or separate by default list separator. If this argument is omitted, the value of the
default table separator property is used.
[number of rows integer] Optional. The number of rows in the table. If this argument is
omitted, Word sets the number of rows, based on the contents of the range or selection.
[number of columns integer] Optional. The number of columns in the table. If this argument is
omitted, Word sets the number of columns, based on the contents of the range or selection.
[initial column width integer] Optional. The initial width (in points) of each column. If this
argument is omitted, Word calculates and adjusts the column width so that the table stretches
from margin to margin.
[table format enumeration] Optional. Specifies one of the predefined formats listed in the Table
AutoFormat dialog box (Table menu). Can be any valid table style.
[apply borders Boolean] Optional. True to apply the border properties of the specified format.