MailMergeFields.AddMergeSeq method (Word)
Adds a MERGESEQ field to a mail merge main document. Returns a MailMergeField object.
Syntax
expression. AddMergeSeq
( _Range_
)
expression Required. A variable that represents a 'MailMergeFields' collection.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
Range | Required | Range object | The location for the MERGESEQ field. |
Return value
MailMergeField
Remarks
A MERGESEQ field inserts a number based on the sequence in which records are merged (for example, when record 50 of records 50 to 100 is merged, MERGESEQ inserts the number 1).
Example
This example inserts text and a MERGESEQ field at the end of the active document.
Dim rngTemp As Range
Set rngTemp = ActiveDocument.Content
rngTemp.Collapse Direction:=wdCollapseEnd
ActiveDocument.MailMerge.Fields.AddMergeSeq Range:=rngTemp
rngTemp.InsertAfter "Sequence Number: "
See also
MailMergeFields Collection Object
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.