MailMergeDataSource.RecordCount Property
Word Developer Reference |
Returns a Long that represents the number of records in the data source. Read-only.
Syntax
expression.RecordCount
expression An expression that returns a MailMergeDataSource object.
Remarks
If Microsoft Office Word cannot determine the number of records in a data source, the RecordCount property will return a value of -1.
Example
This example loops through the records in the data source and verifies that the postal code field (field six in this example) is not fewer than five digits. If it is, it removes the record from the mail merge. If you want to make sure that the locator code is added to the postal code, you can change the length value from 5 to 10. Therefore, if a postal code is fewer than ten digits it will be removed from the mail merge.
Visual Basic for Applications |
---|
|
See Also