[Table of Contents] [docx version]

WordprocessingML Reference Material - Table of Contents

MERGEREC

Syntax:

MERGEREC

Description: Results in «MERGEREC». Use this in a mail merge to print the number of the corresponding merged data record in each resulting merged document. The number reflects the sequential order of the data records that were selected and possibly sorted for merging with the active main document. It does not indicate the actual order of the records as they occur in the physical data source. [Note: A personnel database might contain thousands of records. However, to send a form letter to employees who've reached their five-year anniversary with your company, you'd select as your data source only the records of those five-year employees, a much smaller set of records. To print a physical record number, you must include a record number field in the data source and insert the corresponding merge field in the main document. end note]

Field Value: «MERGEREC».

Switches: None.

[Example: The following example uses a MERGEREC field inside a formula to create unique invoice numbers. When the main document is merged with the data source, the number resulting from the MERGEREC field is added to the numbers representing the date and time the invoices are printed.

Invoice Number: = { PRINTDATE \@ "MMddyyyyHHmm" + MERGEREC }

The result might be:

Invoice Number for record 12, printed on Feb. 13, 2003 at 9:46:
02132003094612

end example]