CalendarView.DayWeekTimeScale 属性 (Outlook)CalendarView.DayWeekTimeScale Property (Outlook)

返回或设置一个代表用于表示**CalendarView** 对象中的时间段刻度**OlDayWeekTimeScale** 常量。Returns or sets an OlDayWeekTimeScale constant that represents the scale used to represent time periods in a CalendarView object. 为可读/写属性。Read/write.


expressionexpression. DayWeekTimeScale

_表达式_代表CalendarView对象的变量。expression A variable that represents a CalendarView object.


下面的 Visual Basic for Applications (VBA) 示例在日历默认文件夹,创建一个新的CalendarView对象,然后将其配置为在多日模式下,显示连续 14 天,并显示每小时内的 Outlook 项目时间刻度。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, _ 
 ' 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. 
 End With 
End Sub

另请参阅See also

日历视图对象CalendarView Object