LastRecord Property

LastRecord Property
This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Returns or sets a Long that represents the number of the last data record to be merged in a mail merge operation. Read/write.

expression.LastRecord

expression   Required. An expression that returns a MailMergeDataSource object.

Example

This example sets the active record as the first record to be merged and then sets the last record as the record two records forward in the data source.  This example assumes that the active publication is a mail merge publication.

  Sub RecordOne()
    With ActiveDocument.MailMerge
        .DataSource.FirstRecord = .DataSource.ActiveRecord
        .DataSource.LastRecord = .DataSource.ActiveRecord + 2
        .Execute Pause:=True
    End With
End Sub