CalendarView.DisplayedDates property (Outlook)
Returns a Variant array containing strings that represent the days displayed in a CalendarView object. Read-only.
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.
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
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for