Microsoft Word Suite
242
Example
This example creates a new Avery 2160 minilabel document using a predefined address.
set addr to "Terry Earls" & return & "123 Skye St." & return ¬
& "Our Town, WA 98004"
create new mailing label document mailing label object name "2160 mini" ¬
address addr without extract address
This example creates a new Avery 5664 shipping-label document using the selected text as the
address.
set addr to content of text object of selection
create new mailing label document mailing label object name "5664" ¬
address addr laser tray printer upper bin
Command: create range
Returns a text range object by using the specified starting and ending character positions.
Syntax
create range document Required. An expression that returns a document object.
[start integer] Optional. The starting character position.
[end integer] Optional. The ending character position.
Remarks
Character position values begin with 0 (zero) at the beginning of the document. All characters are
counted, including nonprinting characters. Hidden characters are counted even if they're not
displayed. If you don't specify starting and ending character positions for the create range
command, the entire document is returned as a text range object.
Example
This example applies bold formatting to the first 10 characters in the active document.
set bold of (create range active document start 0 end 10) to true
This example creates a range that starts at the beginning of the active document and ends at the end
of the selection.
set myRange to create range active document start 0 end (selection end ¬
of
selection)
This example sets the variable
myRange
to paragraphs three through six in the active document, and
then it right aligns the paragraphs in the range.
set aDoc to active document
if (count of paragraphs of aDoc) 6 then
set myRange to create range aDoc start (start of content of text object ¬
of paragraph 3 of aDoc) end (end of content of text object of ¬
paragraph 6 of aDoc)
set alignment of paragraph format of myRange to align paragraph right
end if