Recipients Property (MessageFilter Object)

The Recipients property sets filtering on whether a message's recipients include at least one recipient with a particular name. Read/write.

Syntax

objMessageFilter.Recipients

Data Type

String

Remarks

The Recipients property specifies that the message filter should pass only messages with one or more recipients having a name corresponding to the Recipients property. The filter passes the message if the Name property of any of its Recipient objects contains the filter's Recipients property as a substring.

Example

This code fragment copies the first valid recipient from an original message to a message filter in order to restrict the Messages collection to messages containing that recipient:

Dim objOneRecip as Recipient 
' assume objMessage and objMessageFilter are valid 
For i = 1 To objMessage.Recipients.Count Step 1 
    strRecipName = objMessage.Recipients.Item(i).Name 
' or objMessage.Recipients(i) since Item and Name are default properties 
    If strRecipName <> "" Then 
        objMessageFilter.Recipients = strRecipName 
        Exit For 
    End If 
Next i