Class NavigationGroups (Outlook VBA)

Contains a set of NavigationGroup objects that represent the navigation groups displayed by a navigation module in the navigation pane. To use a NavigationGroups class variable it first needs to be instantiated, for example

For Each

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


Dim cme As CalendarModule: Set cme = 
Dim ngp As NavigationGroup
For Each ngp In cme.NavigationGroups
	
Next ngp

Class

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

This property returns olNavigationGroups for the NavigationGroups object.


Dim ngs As NavigationGroups: Set ngs = 
Dim oocsClass As OlObjectClass
oocsClass = ngs.Class

Count

Returns a Long indicating the count of objects in the specified collection.


Dim ngs As NavigationGroups: Set ngs = 
Dim lngCount As Long
lngCount = ngs.Count

Create

Creates and returns a new NavigationGroup object, added to the end of the NavigationGroups collection.

A NavigationGroups collection can contain multiple NavigationGroup objects with the same Name property values. An error occurs if an add-in attempts to add more than 50 navigation groups to a NavigationGroups collection, or if an add-in attempts to add a NavigationGroup object to the NavigationGroups collection of a MailModule object.

Create (GroupDisplayName)

GroupDisplayName: The value of the Name property for the new NavigationGroup object.


Dim strGroupDisplayName As String: strGroupDisplayName = 
Dim ngs As NavigationGroups: Set ngs = 
Dim ngpCreate As NavigationGroup
Set ngpCreate = ngs.Create(GroupDisplayName:=strGroupDisplayName)

Delete

Deletes the specified NavigationGroup object from the NavigationGroups collection.

The Delete method raises an error if:

Delete (Group)

Group: The navigation group to be deleted.


Dim ngs As NavigationGroups: Set ngs = 
ngs.Delete Group:=

GetDefaultNavigationGroup

Returns the NavigationGroup that corresponds to the selected default shared folder group.

If the default navigation group specified in DefaultFolderGroup was deleted or otherwise doesn't exist, it is automatically created if the parent NavigationModule object supports the specified navigation group type. An error occurs if the parent NavigationModule object does not support creating this navigation group type.

GetDefaultNavigationGroup (DefaultFolderGroup)

DefaultFolderGroup: The type of navigation group to be retrieved.


Dim ngs As NavigationGroups: Set ngs = 
Dim ngpGetDefaultNavigationGroup As NavigationGroup
Set ngpGetDefaultNavigationGroup = ngs.GetDefaultNavigationGroup(DefaultFolderGroup:=olCustomFoldersGroup)

Item

Returns a NavigationGroup object from the collection.

The index value of a NavigationGroup in the collection represents the ordinal position of the navigation group when displayed in the navigation pane. Changing the position of navigation groups also changes the index values of navigation groups contained within the NavigationGroups collection.

Item (Index)

Index: The index number of the object.


Dim ngs As NavigationGroups: Set ngs = 
Dim ngp As NavigationGroup
Set ngp = ngs(Index:=1)

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: