MailMergeFilterCriterion.Column property (Publisher)

Returns a String that represents the name of the field in the mail merge data source to use in the filter. Read/write.

Syntax

expression.Column

expression A variable that represents a MailMergeFilterCriterion object.

Example

The following example changes an existing filter to remove from the mail merge all records that don't have a Region field equal to WA.

Sub SetQueryCriterion() 
 Dim intItem As Integer 
 With ActiveDocument.MailMerge.DataSource.Filters 
 For intItem = 1 To .Count 
 With .Item(intItem) 
 If .Column = "Region" Then 
 .Comparison = msoFilterComparisonNotEqual 
 .CompareTo = "WA" 
 If .Conjunction = "Or" Then .Conjunction = "And" 
 End If 
 End With 
 Next intItem 
 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.