Skip to Content
CDO & MAPI Programming with Visual Basic:
book

CDO & MAPI Programming with Visual Basic:

by Dave Grundgeiger
October 2000
Intermediate to advanced
384 pages
10h 22m
English
O'Reilly Media, Inc.
Content preview from CDO & MAPI Programming with Visual Basic:

Using Message Filters with Task Folders

Recall from Chapter 7 that Messages collections can be filtered using the MessageFilter object. The same technique can be applied to limit the set of tasks returned in a task folder’s Messages collection. Although the MessageFilter object can’t filter on task item-specific properties, such as due date, some of the properties that can be filtered are nevertheless useful when working with tasks. The properties of the MessageFilter object that can be applied to tasks are:

Conversation

Setting the Conversation property causes the associated Messages collection to contain only Message objects having their ConversationTopic properties equal to this value. The datatype is String.

Fields

By adding Field objects to the MessageFilter object’s Fields collection, it is possible to filter on properties that are not directly accessible through the MessageFilter object. For example, this code restricts a Messages collection to items having attachments:

' CdoMessages already Dim'ed and Set.
Dim CdoMessageFilter As MAPI.MessageFilter
Dim CdoFields As MAPI.Fields

Set CdoMessageFilter = CdoMessages.Filter
Set CdoFields = CdoMessageFilter.Fields
CdoFields.Add CdoPR_HASATTACH, True

' At this point, CdoMessages only returns items that have attachments.
Importance

Setting the Importance property causes the associated Messages collection to contain only Message objects having their Importance properties equal to this value. It is a Long that can be set to CdoLow ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Excel® 2007 VBA Programmer's Reference

Excel® 2007 VBA Programmer's Reference

John Green, Stephen Bullen, Rob Bovey, Michael Alexander
COM Programming with Microsoft® .NET

COM Programming with Microsoft® .NET

John Paul Mueller, Julian Templeman

Publisher Resources

ISBN: 156592665XSupplemental ContentCatalog PageErrata