AppointmentItem.Duration 屬性 (Outlook)

會傳回或設定 Long,指出 AppointmentItem 的持續時間 (以分鐘為單位)。 讀取/寫入。

語法

expressionDuration

表達 代表 AppointmentItem 物件的 變數。

範例

這個 Visual Basic for Applications 範例會使用 Application.CreateItem 來建立約會,並使用 AppointmentItem.MeetingStatus 將會議狀態設定為 「Meeting」,以將其轉換成同時具有必要和選擇性出席者的會議邀請。

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

另請參閱

AppointmentItem 物件

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應