Class NavigationFolder (Outlook VBA)

The class NavigationFolder represents a navigation folder displayed in a navigation group of a navigation module in the navigation pane. To use a NavigationFolder class variable it first needs to be instantiated, for example

For Each

Here is an example of processing the NavigationFolder items in a collection.


Dim ngp As NavigationGroup: Set ngp = 
Dim nfr As NavigationFolder
For Each nfr In ngp.NavigationFolders
	With nfr
		
	End With
Next nfr

Class

Returns an OlObjectClass constant indicating the object's class. Here you can find possible values for OlObjectClass.

This property returns olNavigationFolder for the NavigationFolder object.


Dim nfr As NavigationFolder: Set nfr = 
Dim oocsClass As OlObjectClass
oocsClass = nfr.Class

DisplayName

Returns a String representing the display name of the NavigationFolder object.

Use NavigationFolder.DisplayName, instead of Folder.Name, to get the name of a shared folder.


Dim nfr As NavigationFolder: Set nfr = 
Dim strDisplayName As String
strDisplayName = nfr.DisplayName

Folder

Returns a Folder object that represents the shared or linked folder associated with the navigation folder.


Dim nfr As NavigationFolder: Set nfr = 
Dim As Variant
nfr.Folder

IsRemovable

Returns a Boolean value that indicates whether the NavigationFolder object can be removed from the navigation pane.

Only shared or linked folders can be programmatically removed from the navigation pane.


Dim nfr As NavigationFolder: Set nfr = 
Dim booIsRemovable As Boolean
booIsRemovable = nfr.IsRemovable

IsSelected

Returns or sets a Boolean variable that indicates whether the NavigationFolder object is selected for display.

Navigation folders contained in a Calendar navigation module are treated differently than navigation folders in other navigation modules. If the active explorer uses the Day/Week/Month or Day/Week/Month View with AutoPreview view to display navigation folders in the Calendar navigation module, this property returns True if the navigation folder is checked in the navigation pane (and is therefore displayed either in side-by-side or overlay mode in the active explorer.) Setting this property to False removes a calendar from display in the active explorer. An error occurs if this property is set to True for more than 30 navigation folders. If the active explorer uses another view, such as the All Appointments view, to display navigation folders in the Calendar navigation module, or in navigation modules other than the Calendar navigation module, this property returns True if the navigation folder is selected and currently displayed in the active explorer; otherwise, the property returns False. In either case, an error occurs if the value of this property is set to False for all NavigationFolder objects in the parent NavigationFolders collection, or if the NavigationFolder object is contained by a navigation module other than the navigation module currently displayed in the navigation pane. The SelectedChange event for the parent NavigationFolders collection is raised if the value of this property is changed for a NavigationFolder object in a Calendar navigation module, regardless of the current view.


Dim nfr As NavigationFolder: Set nfr = 
nfr.IsSelected = True

IsSideBySide

Returns or sets a Boolean value that indicates whether the NavigationFolder object is displayed in side-by-side or overlay mode.

Setting this property to True displays the NavigationFolder in side-by-side mode; otherwise, overlay mode is used to display the navigation folder in the current view of the active explorer. The default value for this property is True. Setting this property has no effect for a NavigationFolder object that is not associated with a Calendar module. If the NavigationFolder object is associated with a Calendar module, the value of this property is dependent on the following conditions: If the IsSelected property of the NavigationFolder object is set to False, then this property value has no effect until the IsSelected property is set to True. If the IsSelected property is set to True, then the property value is applied when the NavigationFolder is displayed. However, the IsSideBySide property is automatically set to True if the IsSelected property for only one NavigationFolder associated with the parent CalendarModule object is set to True. In other words, if the NavigationFolder object is the only navigation folder displayed in the current view of the active explorer, then the IsSideBySide property for that one NavigationFolder object is automatically set to True.


Dim nfr As NavigationFolder: Set nfr = 
nfr.IsSideBySide = True

Position

Returns or sets an Long value that represents the ordinal position of the NavigationFolder object when displayed in the navigation pane.

This property can only be set to a value between 1 and the value of the Count property for the parent NavigationFolders object. An error occurs if you attempt to set this property to a value outside that range. Changing the value of this property for a NavigationFolder object changes the Position values of other navigation folders contained by a NavigationFolders collection, depending on the relative change between the new value and the original value of the Position property for that NavigationFolder object:


Dim nfr As NavigationFolder: Set nfr = 
nfr.Position =

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: