TimelineView Object (Outlook)

Office 2013 and later

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Represents a view that displays Outlook items in a timeline.

The TimelineView object, derived from the View object, allows you to create customizable views that allow you to display Outlook items within a timeline.

Outlook provides several built-in TimelineView objects, and you can also create custom TimelineView objects. Use the Add method of the Views collection to add a new TimelineView to a Folder object. Use the Standard property to determine if an existing TimelineView object is built-in or custom.

The TimelineView object supports several different view modes, depending on the desired layout and time period in which to display Outlook items. Use the TimelineViewMode property to set the view mode, the StartField property to specify the Outlook item property that contains the start date, and the EndField property to specify the Outlook item property that contains the end date for Outlook items to be displayed.

You can configure the appearance of the TimelineView, depending on the view mode. Use the ShowWeekNumbers property to indicate whether week numbers are displayed in the time scale for the view. Use the UpperScaleFont and LowerScaleFont properties to specify the font used when displaying, respectively, the upper and lower portions of the time scale for the view.

You can also configure how Outlook items appear within the TimelineView object. Use the ItemFont property to specify the font used to display Outlook item labels and the MaxLabelWidth property to specify the length of labels for Outlook items in the view. Use the DefaultExpandCollapseSetting property to determine if Outlook items are expanded by default in the view. Use the Filter property to determine which Outlook items to display in the view and the GroupByFields collection to specify the Outlook item properties by which Outlook items are grouped in the view. If you set the TimelineViewMode to olTimelineViewMonth, you can use the ShowLabelWhenViewingByMonth property to determine if labels for Outlook items are displayed in the view.

The definition for each TimelineView object is stored in Extensible Markup Language (XML) format. Use the XML property to work with the XML definition for the TimelineView object.

Use the Apply method to apply any changes made to the TimelineView object to the current view. Use the Save method to persist any changes made to the TimelineView object. Use the LockUserChanges property to allow or prevent changes to the user interface for the view.

You can change built-in TimelineView objects, but you cannot delete them. Use the Delete method to delete a custom TimelineView object. Use the Reset method to reset the properties of a built-in TimelineView object to their default values.

The following Visual Basic for Applications (VBA) example configures the current TimelineView object to display Outlook items by month, with week number labels on the lower portion of the timeline scale, with labels no longer than 40 characters.

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 = _ 
 ' 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. 
 End With 
 End If 
End Sub