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

MailMergeFilterCriterion.Conjunction Property (Publisher)

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

Returns or sets an MsoFilterConjunction constant that represents how a filter criterion relates to other filter criteria in the MailMergeFilters object. Read/write.


expression. Conjunction

_expression_A variable that represents a MailMergeFilterCriterion object.

Return Value



The Conjunction property value can be one of the following MsoFilterConjunction constants declared in the Microsoft Office type library.

| msoFilterConjunctionAnd| | msoFilterConjunctionOr|


The following example changes an existing filter to remove from the mail merge all records that do not have a Region field equal to "WA", and then adds the filter to the following filter, so that the the filter criteria must match both filters combined and not just one or the other.

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 
 End With 
End Sub
© 2018 Microsoft