title | keywords | f1_keywords | api_name | ms.assetid | ms.date | ms.localizationpriority | ||
---|---|---|---|---|---|---|---|---|
MailMergeFields.AddMergeRec method (Word) |
vbawd10.chm153026665 |
|
|
50146076-696e-9a78-5e58-4ecb0f32607f |
06/08/2017 |
medium |
Adds a MERGEREC field to a mail merge main document. Returns a MailMergeField object.
expression. AddMergeRec
( _Range_
)
expression Required. A variable that represents a 'MailMergeFields' collection.
Name | Required/Optional | Data type | Description |
---|---|---|---|
Range | Required | Range object | The location for the MERGEREC field. |
MailMergeField
A MERGEREC field inserts the number of the current record (the position of the record in the current query result) during a mail merge.
This example inserts text and a MERGEREC field at the beginning of the active document.
Dim rngTemp As Range
Set rngTemp = ActiveDocument.Range(Start:=0, End:=0)
ActiveDocument.MailMerge.Fields.AddMergeRec Range:=rngTemp
rngTemp.InsertAfter "Record Number: "
MailMergeFields Collection Object
[!includeSupport and feedback]