Conjunction Property [Publisher 2003 VBA Language Reference]
MsoFilterConjunction
MsoFilterConjunction can be one of these MsoFilterConjunction constants. |
msoFilterConjunctionAnd |
msoFilterConjunctionOr |
expression.Conjunction
expression Required. An expression that returns one of the objects in the Applies To list.
Example
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
Next
End With
End Sub
Applies to | MailMergeFilterCriterion Object