Outlook) (TimelineView 物件

代表會用時間表顯示 Outlook 項目的檢視。

註解

您可以使用衍生自 View 物件的 TimelineView 物件,建立可用時間表顯示 Outlook 項目的可自訂檢視。

Outlook 提供多個內建 TimelineView 物件,但您也可以建立自訂 TimelineView 物件。 使用Views集合的Add方法,將新的TimelineView新增至Folder物件。 使用 Standard 屬性來判斷現有的 TimelineView 物件是內建還是自訂。

依據想要顯示 Outlook 項目的版面配置及期間,TimelineView 物件支援幾種不同的檢視模式。 使用 TimelineViewMode 屬性可設定檢視模式、 使用 StartField 屬性來指定包含開始日期的 Outlook 專案屬性,以及使用 EndField 屬性來指定 Outlook 專案屬性,其中包含要顯示之 Outlook 專案的結束日期。

您可以依據檢視模式來設定 TimelineView 的外觀。 使用 ShowWeekNumbers 屬性來指出是否要在檢視的時間刻度中顯示周數。 使用 UpperScaleFontLowerScaleFont 屬性來指定在顯示檢視的時間刻度上下半部時所使用的字型。

您也可以設定 Outlook 項目出現在 TimelineView 物件中的外觀。 使用 ItemFont 屬性可指定用來顯示 Outlook 專案標籤的字型,並使用 MaxLabelWidth 屬性來指定檢視中 Outlook 專案的標籤長度。 使用 DefaultExpandCollapseSetting 屬性來判斷檢視中是否預設會展開 Outlook 專案。 使用 Filter 屬性可決定要在檢視中顯示哪些 Outlook 專案,以及使用 GroupByFields 集合來指定 Outlook 專案屬性,Outlook 專案會依其在檢視中分組。 如果您將 TimelineViewMode 設定為 olTimelineViewMonth,則可以使用 ShowLabelWhenViewingByMonth 屬性來決定是否要在檢視中顯示 Outlook 項目的標籤。

每個 TimelineView 物件的定義都會以可延伸標記語言 (XML) 格式儲存。 使用 XML 屬性來處理 TimelineView 物件的 XML 定義。

使用 Apply 方法,將 對 TimelineView 物件所做的任何變更套用至目前的檢視。 使用 Save 方法可保存對 TimelineView 物件所做的任何變更。 使用 LockUserChanges 屬性可允許或防止變更檢視的使用者介面。

您可以變更內建 的 TimelineView 物件,但無法刪除它們。 使用 Delete 方法可刪除自訂 TimelineView 物件。 使用 Reset 方法,將內建 TimelineView 物件的屬性重設為其預設值。

範例

下列的 Visual Basic for Applications (VBA) 範例將目前的 TimelineView 物件設定為依月份顯示 Outlook 項目,且在時間表刻度的下方顯示週數標籤,而標籤的長度不超過 40 個字元。

Private Sub ConfigureMonthTimelineView() 
 
 Dim objTimelineView As TimelineView 
 
 
 
 If Application.ActiveExplorer.CurrentView.ViewType = _ 
 
 olTimelineView Then 
 
 
 
 ' Obtain a TimelineView object reference for the 
 
 ' current timeline view. 
 
 Set objTimelineView = _ 
 
 Application.ActiveExplorer.CurrentView 
 
 
 
 ' Configure the TimelineView object so that it displays 
 
 ' Outlook items by month and week, displaying labels 
 
 ' no larger than 40 characters for Outlook items 
 
 ' displayed in the view. 
 
 With objTimelineView 
 
 ' Display items by month. 
 
 .TimelineViewMode = olTimelineViewMonth 
 
 
 
 ' Display week numbers. If this value is 
 
 ' set to False when TimelineViewMode is 
 
 ' set to olTimelineViewMonth, the day 
 
 ' numbers are displayed instead. 
 
 .ShowWeekNumbers = True 
 
 
 
 ' Display labels for Outlook items 
 
 ' while TimelineViewMode is set to 
 
 ' olTimelineViewMonth. 
 
 .ShowLabelWhenViewingByMonth = True 
 
 
 
 ' Show no more than the first 40 characters 
 
 ' for each Outlook item in the view. 
 
 .MaxLabelWidth = 40 
 
 
 
 ' Save and apply the view. 
 
 .Save 
 
 .Apply 
 
 End With 
 
 End If 
 
 
 
End Sub 
 

方法

名稱
Apply
Copy
Delete
GoToDate
Reset
Save

屬性

名稱
Application
Class
DefaultExpandCollapseSetting
EndField
Filter
GroupByFields
ItemFont
Language
LockUserChanges
LowerScaleFont
MaxLabelWidth
Name
Parent
SaveOption
Session
ShowLabelWhenViewingByMonth
ShowWeekNumbers
Standard
StartField
TimelineViewMode
UpperScaleFont
ViewType
XML

請參閱

Outlook 物件模型參考

支援和意見反應

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