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:

Creating an Appointment

Creating an appointment is much like creating a message, which we did in Chapter 6. To create an appointment, get a reference to the folder in which you’d like to create the appointment, then call the Add method of the folder’s Messages collection. The syntax of the Add method is the same here as it is when creating an email message. (See Section 6.3 in Chapter 6.) Once the item is created, set its appointment-specific properties as desired and call the AppointmentItem object’s Update method to save the appointment in the message store. Example 8-2 demonstrates creating an appointment that begins at 10:00 on the morning of April 5, 2001, and ends that same morning at 10:30. Note in the example that the user’s time is being marked as busy, and also that the user will be reminded of the appointment 15 minutes prior to its start time.

Example 8-2. Creating an Appointment

' gCdoSession previously Dim'ed, Set, and loggon on with valid profile. 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 folder's Messages collection. Set CdoMessages = CdoFolder.Messages ' Add a new item to the Messages collection. Set CdoAppointmentItem = CdoMessages.Add ' Set the appointment's properties. With CdoAppointmentItem .Subject = "XYZ Company Proposal" .Text = "XYZ is coming to demonstrate their widgets." ...
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