會傳回或設定 Long,指出 AppointmentItem 的持續時間 (以分鐘為單位)。 讀取/寫入。
語法
expression。 Duration
運算式 代表 AppointmentItem 物件的變數。
範例
此 Visual Basic for Applications 範例使用 Application.CreateItem 建立約會,並使用 AppointmentItem.MeetingStatus 將會議狀態設定為 “會議”,以將其轉換為具有必要和選擇性出席者的會議要求。
Sub ScheduleMeeting()
Dim myItem as AppointmentItem
Dim myRequiredAttendee As Recipient
Dim myOptionalAttendee As Recipient
Dim myResourceAttendee As Recipient
Set myItem = Application.CreateItem(olAppointmentItem)
myItem.MeetingStatus = olMeeting
myItem.Subject = "Strategy Meeting"
myItem.Location = "Conference Room B"
myItem.Start = #9/24/2002 1:30:00 PM#
myItem.Duration = 90
Set myRequiredAttendee = myItem.Recipients.Add ("Nate Sun")
myRequiredAttendee.Type = olRequired
Set myOptionalAttendee = myItem.Recipients.Add ("Kevin Kennedy")
myOptionalAttendee.Type = olOptional
Set myResourceAttendee = myItem.Recipients.Add("Conference Room B")
myResourceAttendee.Type = olResource
myItem.Display
End Sub
另請參閱
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。