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:

Reading Tasks

From CDO’s point of view, tasks are stored as Message objects. It’s easy to tell when a Message object represents a task: its Type property is set to "IPM.Task“. It is this value that signifies to Microsoft Outlook, for example, to display an item using the Task form rather than the Message form.

Some points about accessing task items through CDO:

  • A task’s description is found in the Message object’s Subject property.

  • Unlike message items, the Text property of a Message object representing a task item is typically left empty, though it doesn’t have to be.

  • Task items can accommodate rich text. To do this through CDO, use the CdoHelper component introduced in Chapter 6.

  • Task items can accommodate attachments. This is done in the same way as it is with email message items, as discussed in Chapter 6.

  • Most of the really useful task information is stored in named properties, and Microsoft doesn’t document the names (argh!). This is discussed in more detail later in this chapter.

The code in Example 9-1 loads a list box with the task descriptions from the user’s Tasks folder. Sample output is shown in Figure 9-1.

Example 9-1. Loading a List Box with Tasks

Private Sub ShowTasks( ) ' gCdoSession previously Dim'ed, Set, and logged on. Dim CdoFolder As MAPI.Folder Dim CdoMessages As MAPI.Messages Dim CdoMessage As MAPI.Message ' Get the Tasks folder. Set CdoFolder = gCdoSession.GetDefaultFolder(CdoDefaultFolderTasks) ' Get the collection of tasks. Set CdoMessages = CdoFolder.Messages ...
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