Microsoft Word Suite
295
Command: make new data merge sequence field
Adds a MERGESEQ field to a mail merge main document. Returns a data merge field object. A
MERGESEQ field inserts a number based on the sequence in which data records are merged (for
example, when record 50 of records 50 to 100 is merged, MERGESEQ inserts the number 1).
Syntax
make new data merge sequence field Required. An expression that returns a data merge object.
text range text range Required text range object. The location for the MERGESEQ field.
Example
This example inserts text and a MERGESEQ field at the end of the active document.
set myRange to text object of active document
set myRange to collapse range myRange direction collapse end
make new data merge sequence field data merge of active document ¬
text
range
myRange
insert text "Sequence Number: " at myRange
Command: make new data merge set field
Adds a SET field to a mail merge main document. Returns a data merge field object. A SET field
defines the text of the specified bookmark.
Syntax
make new data merge set field data merge Required. An expression that returns a data merge
object.
text range text range Required text range object. The location for the SET field.
name Unicode text Required. The bookmark name that value text is assigned to.
[value text Unicode text] Optional. The text associated with the bookmark specified by the
name argument.
Example
This example adds a SET field at the beginning of the active document and then adds a REF field to
display the text after the selection.
set myRange to create range active document start 0 end 0
make new data merge set field data merge of active document text range ¬
myRange name "Name" value text "Joe Smith"
collapse range text object of selection direction collapse end
make new field at active document with properties {text range:text object ¬
of selection, field type:field ref, field text:"Name"}