Table of contents

MailMergeDataSource.SetAllErrorFlags 方法 (发布服务器)MailMergeDataSource.SetAllErrorFlags Method (Publisher)

office 365 dev account|上次更新日期: 2018/3/13
3 参与人员

将邮件合并数据源中的所有记录标记为地址域中包含无效数据。Marks all records in a mail merge data source as containing invalid data in an address field.


表达式SetAllErrorFlags无效InvalidCommentexpression. SetAllErrorFlags( Invalid, InvalidComment)

_expression_A 表示MailMergeDataSource对象的变量。_expression_A variable that represents a MailMergeDataSource object.


名称Name必需/可选Required/Optional数据类型Data Type说明Description
无效Invalid必需RequiredBooleanBoolean如此,则将邮件合并的数据源中的所有记录都标记为无效。True marks all records in the data source of a mail merge as invalid.
InvalidCommentInvalidComment可选OptionalStringString说明无效设置的文本。Text describing the invalid setting.


您可以单独标记内使用InvalidAddressInvalidComments属性的地址字段包含无效数据的数据源中的记录。You can individually mark records in a data source that contain invalid data in an address field using the InvalidAddress and InvalidComments properties.


本示例将数据源中的所有记录标记为包含无效数据的地址域,并设置备注,说明无效的原因,再从邮件合并中排除所有记录。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
© 2018 Microsoft