MailMergeDataSource.SetAllIncludedFlags method (Publisher)
True to include all data source records in a mail merge.
Syntax
expression.SetAllIncludedFlags (Included)
expression A variable that represents a MailMergeDataSource object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
Included | Required | Boolean | True to include all data source records in a mail merge. False to exclude all data source records from a mail merge. |
Remarks
You can set individual records in a data source to be included in or excluded from a mail merge by using the Included property.
Example
This example marks all records in the data source as containing an invalid address field, sets a comment as to why it is invalid, and excludes all records from the mail merge.
Sub FlagAllRecords()
With ActiveDocument.MailMerge.DataSource
.SetAllErrorFlags Invalid:=True, InvalidComment:= _
"All records in the data source have only 5-" _
& "digit ZIP Codes. Need 5+4 digit ZIP Codes."
.SetAllIncludedFlags Included:=False
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.