Duration Property (AppointmentItem Object)

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

Syntax

objAppointment.Duration

Data Type

Long

Remarks

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. Exceeding these limits can result in a return of CdoE_INVALID_PARAMETER. The default value of Duration is 30 minutes.

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.

Example

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!