Message Filtering

The MessageFilter object provides developers with the ability to simply filter all of the messages in a particular folder to select only those which meet certain criteria. The criteria on which the filter can be applied are exposed as properties. The following code fragment illustrates how easy the MessageFilter object is to use.

Set objMsgFilt = objSession.Inbox.Messages.Filter
objMsgFilt.Unread = True   ' Allow only unread messages
objMsgFilt.Subject = "Cow" ' Allow only messages with "Cow" in the Subject

© 1998 by Wrox Press. All rights reserved.