{ MERGEREC }
Displays «MERGEREC» as a field result (field results: Text or graphics inserted in a document when Microsoft Word carries out a field's instructions. When you print the document or hide field codes, the field results replace the field codes.). Use this field (field: A set of codes that instructs Microsoft Word to insert text, graphics, page numbers, and other material into a document automatically. For example, the DATE field inserts the current date.) in a mail merge main document (main document: In a mail-merge operation in Word, the document that contains the text and graphics that are the same for each version of the merged document, for example, the return address or salutation in a form letter.) to print the number of the corresponding merged data record (data record: A complete set of related information that corresponds to one row of information in the data source. All information about one client in a client mailing list is an example of a data record.) in each resulting merged document.
The number reflects the sequential order of the data records you've 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 (data source: A file that contains the information to be merged into a document. For example, the list of names and addresses you want to use in a mail merge. You must connect to the data source before you can use the information in it.).
For example, a personnel database in Microsoft Access 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.
Example
The following example uses a MERGEREC field inside an = (Formula) field 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.
Field:
Invoice Number: { = { PRINTDATE \@ "MMddyyyyHHmm" } + { MERGEREC } }
Result:
Invoice Number for record 12, printed on Feb. 13, 2003 at 9:46:
02132003094612