Microsoft Word Suite
87
Use data merge field index, where index is the index number, to return a single data merge field
object. The following example displays the field code of the first mail merge field in the active
document.
display dialog (content of data merge field range of data merge field 1 of ¬
data merge of active document) as string
Remarks
Several commands are available for adding fields related to a data merge operation, such as
make
new data merge ask field
and
make new data merge fill in field
.
Properties
data merge field range
Returns or sets a text range object that represents a data merge field's code. A field's code is
everything that's enclosed by the field characters ({ }) including the leading space and trailing
space characters. You can access a field's code without changing the view from field results.
Read/write.
form field type
Returns the field type. Can be one of the Word fields. Read-only.
locked
True if the specified field is locked. When a field is locked, you cannot update the field results.
Read/write.
next data merge field
Returns the next data merge field in the data merge fields list. Read-only.
previous make merge field
Returns the previous data merge field in the data merge fields list. Read-only.
Class: data merge field name
Plural
data merge field names
Represents a data merge field name in a data source. The data merge field names list includes all
the data field names in a data merge data source.
Use data merge field name index, where index is the name or index number of the data merge field
name, to return a single data merge field name object. The index number represents the position of
the field in the data merge data source. The following example retrieves the name of the last field in
the data source attached to the active document.
set alast to count of data merge field names of data source of data merge of ¬
active
document
set afirst to name of data merge field name alast of data source of ¬
data merge of active document
display dialog afirst as string
You cannot add fields to the data merge field names list. Field names in a data source are
automatically included in the data merge field names list.