Duration Property (AppointmentItem Object)

Exchange Server 2003

Topic Last Modified: 2004-06-09

The Duration property returns the duration of this appointment in minutes. Read-only.

objAppointment.Duration

Long

The Duration property contains the number of minutes the appointment is to last. The minimum value is 0 and the maximum value is 1,490,000, which is treated as infinity.

Since Duration is read-only, you must change the StartTime or EndTime property to cause a new value to be calculated for Duration.

Among its possible values, the Duration property can be any multiple of 24 hours that does not exceed its maximum value. If an appointment has such a value for Duration, Microsoft® Schedule+ interprets it as lasting exactly 24 hours. That is, Schedule+ treats Duration values of 0, 1440, 2880, 4320, and so on as if they were 1440.

Calendar folders are not supported in the public folders store provided with Microsoft® Exchange, and AppointmentItem objects are stored as Message objects. An attempt to read Duration in this case returns CdoE_NO_SUPPORT.

This code fragment causes CDO to calculate a value of 90 minutes for the Duration property of an appointment:

Dim objAppt As Appointment
' ...
objAppt.EndTime = DateAdd("n", 90, objAppt.StartTime) ' n for minutes!
 
Show: