MailMergeDataSource.SetAllErrorFlags procedure builder

MailMergeDataSource.SetAllErrorFlags (Word)

Marks all records in a mail merge data source as containing invalid data in an address field.

You can individually mark data source records that contain invalid data in an address field by using the InvalidAddress and InvalidComments properties.

SetAllErrorFlags (Invalid, InvalidComment)

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

Arguments

The following arguments are required:

Invalid (Boolean) - True marks all records in the data source of a mail merge as invalid.

InvalidComment (String) - Text describing the invalid setting.