Düzenle

Aracılığıyla paylaş


CalendarView.DaysInMultiDayMode property (Outlook)

Returns or sets a Long value that represents the number of consecutive days displayed in the CalendarView object. Read/write

Syntax

expression. DaysInMultiDayMode

expression A variable that represents a CalendarView object.

Remarks

This property can be set to a value between 2 and 14. If this property is set to a value less than 2, the property is set to 2. If the this property is set to a value greater than 14, the property is set to 14. The default value for this property is 5.

Example

The following Visual Basic for Applications (VBA) example creates a new CalendarView object in the Calendar default folder, and then configures it to display 14 consecutive days in multi-day mode, with Outlook items displayed within an hourly time scale.

Sub CreateTwoWeekView() 
 
 Dim objNamespace As NameSpace 
 
 Dim objFolder As Folder 
 
 Dim objView As CalendarView 
 
 
 
 ' Obtain Folder object reference to the Calendar default folder. 
 
 Set objNamespace = Application.GetNamespace("MAPI") 
 
 Set objFolder = objNamespace.GetDefaultFolder(olFolderCalendar) 
 
 
 
 ' Create a new CalendarView object named "Two Weeks". 
 
 Set objView = objFolder.Views.Add("Two Weeks", _ 
 
 olCalendarView, _ 
 
 olViewSaveOptionAllFoldersOfType) 
 
 
 
 ' Configure the new CalendarView object. 
 
 With objView 
 
 ' Display the view in multi-day mode. 
 
 .CalendarViewMode = olCalendarViewMultiDay 
 
 
 
 ' Display 14 consecutive days in multi-day 
 
 ' mode. 
 
 .DaysInMultiDayMode = 14 
 
 ' Set the time scale for the view in one-hour 
 
 ' intervals. 
 
 .DayWeekTimeScale = olTimeScale60Minutes 
 
 
 
 ' Save and apply the new CalendarView object. 
 
 .Save 
 
 .Apply 
 
 End With 
 
End Sub

See also

CalendarView Object

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.