CalendarView.CalendarViewMode 属性 (Outlook)

返回或设置一个 OlCalendarViewMode ,该值确定 CalendarView 对象当前的视图模式。 读/写。

语法

expressionCalendarViewMode

表达 一个代表 CalendarView 对象的变量。

示例

下面的 Visual Basic for Applications (VBA) 示例配置当前的 日历视图 对象,以显示一天中,使用 8 磅宋体字体显示的项目和 16 磅宋体字体可以显示时间值和视图中的任务标题。

Sub ConfigureDayViewFonts() 
 
 Dim objView As CalendarView 
 
 
 
 ' 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 
 
 
 
 With objView 
 
 ' Set the calendar view to show a 
 
 ' single day. 
 
 .CalendarViewMode = olCalendarViewDay 
 
 
 
 ' Set the DayWeekFont to 8-point Verdana. 
 
 .DayWeekFont.Name = "Verdana" 
 
 .DayWeekFont.Size = 8 
 
 
 
 ' Set the DayWeekTimeFont to 16-point Verdana. 
 
 .DayWeekTimeFont.Name = "Verdana" 
 
 .DayWeekTimeFont.Size = 16 
 
 
 
 ' Save the calendar view. 
 
 .Save 
 
 End With 
 
 End If 
 
End Sub

另请参阅

日历视图对象

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。