Microsoft Word Suite
160
To return the selection type (for example, a block selection or an insertion point), use the selection
type property. The following example selects the current paragraph if the selection is an insertion
point.
if selection type of selection is selection ip then
select text object of paragraph 1 of selection
end if
Use the get selection information command to return information about the selection. If the
selection is in a table, the following example displays the number or rows and columns in the table.
if (get selection information selection information type with in table) ¬
is
"True"
then
display dialog "Columns = " & (get selection information selection ¬
information type maximum number of columns) & return & "Rows = " ¬
& (get selection information selection information type ¬
maximum number of rows)
end if
To select an item in a document, use the select command. The following example selects the first
bookmark in the active document and formats it to appear in red.
if (count of bookmarks of active document) 1 then
select bookmark 1 of active document
set color index of font object of selection to red
end if
Remarks
To return a text range object from the selection object, use the text object property. The following
example defines the variable
myRange
as the selected range.
set myRange to text object of selection
There can be only one selection object per window pane; however, you can have multiple text range
objects defined in a single document. A text range object represents a document area that may or
may not be selected. Working with text range objects, you can manipulate a document with
minimal screen updates.
Properties
IP at end of line
True if the insertion point is at the end of a line that wraps to the next line. False if the
selection isn't collapsed, if the insertion point isn't at the end of a line, or if the insertion point
is positioned before a paragraph mark. Read-only.
bookmark id
Returns the number of the bookmark that encloses the beginning of the specified selection or
range; returns 0 (zero) if there's no corresponding bookmark. The number corresponds to the
position of the bookmark in the document: 1 for the first bookmark, 2 for the second one, and
so on. Read-only.