Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

MailMergeDataSource.LastRecord Property

Office 2007
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.



expression   A variable that represents a MailMergeDataSource object.

Return Value


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.

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

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.