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:

Viewing Calendar Contents

Appointment and meeting information is retrieved in one of the following four ways:

  1. Iterate through the entire Messages collection of the calendar folder to process all AppointmentItem objects. The following code does this:

    ' gCdoSession previously Dim'ed, Set, and logged on.
    
    Dim CdoFolder As MAPI.Folder
    Dim CdoMessages As MAPI.Messages
    Dim CdoAppointmentItem As MAPI.AppointmentItem
    
    ' Get the user's Calendar folder.
    Set CdoFolder = gCdoSession.GetDefaultFolder(CdoDefaultFolderCalendar)
    
    ' Get the collection of appointments.
    Set CdoMessages = CdoFolder.Messages
    
    ' Loop for each appointment.
    For Each CdoAppointmentItem In CdoMessages
       '
       ' Code that does something with an AppointmentItem object
       '
    Next CdoAppointmentItem
  2. Apply a filter to the Messages collection, then iterate through the resulting members. This technique is described in the next section.

  3. Invoke the GetAssociatedAppointment method of the MeetingItem object. This was discussed earlier in this chapter under Section 8.2, in the discussion of the MeetingResponseStatus property of the AppointmentItem object.

  4. If the message ID of the appointment or meeting is known, invoke the GetMessage method of the Session object, as shown here:

    ' CdoSession previously Dim'ed, Set, and logged on.
    ' strMessageID previously Dim'ed and assigned.
    Dim CdoAppointmentItem As MAPI.AppointmentItem
    Set CdoAppointmentItem = CdoSession.GetMessage(strMessageID)

    The message ID can be found in the ID property of the AppointmentItem ...

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