O'Reilly logo

CDO & MAPI Programming with Visual Basic: by Dave Grundgeiger

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Getting Free/Busy Information

It’s not necessary to know another user’s schedule in order to send her a meeting request. If the other user is busy, she is perfectly free to decline the request. However, it is clearly more efficient if the meeting organizer is able to check for mutually free times before sending a meeting request.

Free/busy information is retrieved via the Recipient object’s GetFreeBusy method. The syntax is:

            strFreeBusy = CdoRecipient.GetFreeBusy(StartTime, EndTime, Interval)

The method returns a string that is encoded to represent the messaging user’s free/busy status during the specified period. Each character in the returned string represents one time slot, where the duration of a time slot is given by the Interval parameter. The parameters are used as follows:

StartTime

This is a Variant/Date that specifies the start date and time of the block of time for which to check free/busy status.

EndTime

This is a Variant/Date that specifies the end date and time of the block of time for which to check free/busy status.

Interval

This is the duration, in minutes, of each time slot for which to check free/busy status.

For example, to check a user’s availability on January 1, 2001, using a time slot duration of 30 minutes, first obtain a Recipient object representing the user (more on that in a minute), then invoke the Recipient object’s GetFreeBusy method, like this:

strFreeBusy = CdoRecipient.GetFreeBusy( _ StartTime:=#1/1/2001#, _ EndTime:=#1/1/2001 11:59:59 PM#, _ Interval:=30) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required