Syntax
MailMergeFindRecord .Find = text, .Field = text
Remarks
If a main document is active and merged data is visible, displays a merge document for the first data record containing the specified text in the given field. If a data source is active and is a Word document, MailMergeFindRecord selects the first row that matches the specified criteria. You can use MailMergeFindRecord in a main document, a data source, or any document containing data delimited by table cells or separator characters.
Argument | Explanation |
.Find | Text you want to find in the specified field. |
.Field | Limits the search to the specified field name. |
Example
This example displays a merge document for the first data record in which the last name is "Perez." If the data record is found, the number of the record is stored in the variable numRecord.
MailMergeFindRecord .Find = "Perez", .Field = "LastName" If MailMergeFoundRecord() Then numRecord = MailMergeGotoRecord() End If
See Also
MailMergeFirstRecord, MailMergeFoundRecord(), MailMergeGotoRecord, MailMergeLastRecord, MailMergeNextRecord, MailMergePrevRecord, MailMergeViewData