Class CalendarModule (Outlook VBA)
The class CalendarModule represents the Calendar navigation module in the navigation pane of an explorer. To use a CalendarModule class variable it first needs to be instantiated, for example
Class
Returns an OlObjectClass constant indicating the object's class. Here you can find possible values for
This property returns olCalendarModule for the CalendarModule object.
Dim cme As CalendarModule: Set cme =
Dim oocsClass As OlObjectClass
oocsClass = cme.Class
Name
Returns a String value that represents the localized display name for the CalendarModule object.
Dim cme As CalendarModule: Set cme =
Dim strName As String
strName = cme.Name
NavigationGroups
Returns a NavigationGroups object that contains the set of navigation groups associated with the CalendarModule object.
Dim cme As CalendarModule: Set cme =
Dim ngsNavigationGroups As NavigationGroups
Set ngsNavigationGroups = cme.NavigationGroups
NavigationModuleType
Returns an OlNavigationModuleType constant that represents the navigation module type for the object. Here you can find possible values for
This property returns olModuleCalendar for the CalendarModule object.
Dim cme As CalendarModule: Set cme =
Dim onmNavigationModuleType As OlNavigationModuleType
onmNavigationModuleType = cme.NavigationModuleType
Position
Returns or sets a Long value that represents the ordinal position of the CalendarModule object when it is displayed in the navigation pane.
This property can only be set to a value between 1 and 9. An error occurs if you attempt to set it to a value outside of that range. Changing the value of this property for a given CalendarModule object changes the Position values of other navigation modules in a NavigationModules collection, depending on the relative change between the new value and the original value.
Sub MoveCalendarModuleFirst()
Dim objPane As NavigationPane
Dim objModule As CalendarModule
On Error GoTo ErrRoutine
' Get the current NavigationPane object.
Set objPane = Application.ActiveExplorer.NavigationPane
' Get the Calendar navigation module
' from the navigation pane.
Set objModule = objPane.Modules.GetNavigationModule( _
olModuleCalendar)
' If a CalendarModule object is present,
' make it the first navigation module displayed in the
' Navigation Pane.
If Not (objModule Is Nothing) Then
objModule.Position = 1
End If
' Select the Calendar navigation module in the
' Navigation Pane.
Set objPane.CurrentModule = objModule
EndRoutine:
On Error GoTo 0
Set objModule = Nothing
Set objPane = Nothing
Exit Sub
ErrRoutine:
Debug.Print Err.Number & " (&H" & Hex(Err.Number) & ")"
Select Case Err.Number
Case -2147024809 '&H80070057
' Typically occurs if you set the Position
' property less than 1 or greater than 9.
MsgBox Err.Number & " - " & Err.Description, _
vbOKOnly Or vbCritical, _
"MoveCalendarModuleFirst"
End Select
GoTo EndRoutine
End Sub
Session
Returns the NameSpace object for the current session.
The Session property and the GetNamespace method can be used interchangeably to obtain the NameSpace object for the current session. Both members serve the same purpose. For example, the following statements perform the same function:
Visible
Returns or sets a Boolean value that determines whether the CalendarModule object is displayed in the navigation pane.
Dim cme As CalendarModule: Set cme =
cme.Visible = True