CalendarView.DayWeekTimeScale (Outlook)
Returns or sets an OlDayWeekTimeScale constant that represents the scale used to represent time periods in a CalendarView object. Possible return values are olTimeScale10Minutes - Indicates that each time period represents 10 minutes, olTimeScale15Minutes - Indicates that each time period represents 15 minutes, olTimeScale30Minutes - Indicates that each time period represents 30 minutes, olTimeScale5Minutes - Indicates that each time period represents 5 minutes, olTimeScale60Minutes - Indicates that each time period represents 60 minutes, olTimeScale6Minutes - Indicates that each time period represents 6 minutes.
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