Table of contents
Collapse the table of content
Expand the table of content

MailMergeDataSource.ApplyFilter Method (Publisher)

office 365 dev account|Last Updated: 8/24/2017
3 Contributors

Applies a filter to a mail merge data source to remove (or filter out) specified records containing (or not containing) specific data.


expression. ApplyFilter

_expression_A variable that represents a MailMergeDataSource object.


This example adds a new filter that removes all records with a blank Region field and then applies the filter to the active publication. This example assumes that a mail merge data source is attached to the active publication.

Sub FilterDataSource() 
 With ActiveDocument.MailMerge.DataSource 
 .Filters.Add Column:="Region", _ 
 Comparison:=msoFilterComparisonIsBlank, _ 
 End With 
End Sub
© 2018 Microsoft