AddMergeRec Method

Applies To

MailMergeFields collection object.

Description

Adds a MERGEREC field to a mail merge main document. Returns a MailMergeField object. A MERGEREC field inserts the number of the current data record (the position of the data record in the current query result) during a mail merge.

Syntax

expression.AddMergeRec(Range)

expression Required. An expression that returns a MailMergeFields object.

Range Required Range object. The location for the MERGEREC field.

See Also

AddMergeSeq method.

Example

This example inserts text and a MERGEREC field at the beginning of the active document.

Set myRange = ActiveDocument.Range(Start:=0, End:=0)
ActiveDocument.MailMerge.Fields.AddMergeRec Range:=myRange
myRange.InsertAfter "Record Number: "