Share via


CalendarView.DisplayedDates Property

Outlook Developer Reference

Returns or sets a Variant array containing strings that represent the days displayed in a CalendarView object. Read-only.

Version Information
 Version Added:  Outlook 2007

Syntax

expression.DisplayedDates

expression   A variable that represents a CalendarView object.

Remarks

This property returns an array of date strings, in which each date string represents a day displayed in the CalendarView object. The date strings are formatted using the short date format settings for the operating system.

Example

The following Visual Basic for Applications (VBA) example obtains the value of the DisplayedDates property from the current CalendarView object, then displays a dialog box with a summary of that property value.

Visual Basic for Applications
  Sub DisplayDayRange()
    Dim objView As CalendarView
    Dim varArray As Variant
    
    ' Check if the current view is a calendar view.
    If Application.ActiveExplorer.CurrentView.ViewType = _
        olCalendarView Then
        
        ' Obtain a CalendarView object reference for the
        ' current calendar view.
        Set objView = _
            Application.ActiveExplorer.CurrentView
        
        ' Obtain the DisplayedDates value, a string
        ' array of dates representing the dates displayed
        ' in the calendar view.
        varArray = objView.DisplayedDates
        
        ' If the example obtained a valid array, display
        ' a dialog box with a summary of its contents.
        If IsArray(varArray) Then
            MsgBox "There are " & _
                (UBound(varArray) - LBound(varArray)) + 1 & _
                " days displayed, from " & _
                varArray(LBound(varArray)) & _
                " to " & _
                varArray(UBound(varArray))
        End If
    End If
End Sub

See Also