MailMergeDataSource.LastRecord property (Publisher)

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

Syntax

expression.LastRecord

expression A variable that represents a MailMergeDataSource object.

Return value

Long

Example

This example sets the active record as the first record to be merged and then sets the last record as the record that is 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

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.