Customize the Navigation Pane
|Outlook Developer Reference|
In Microsoft Office Outlook 2007, the Navigation Pane provides access to information pertaining to the active explorer, including different view choices and options for accomplishing tasks within that explorer. The NavigationPane object represents the Navigation Pane for an explorer, and can be obtained by calling the NavigationPane property of the Explorer object. If the explorer doesn't contain a Navigation Pane, then this property returns Null (Nothing in Visual Basic.)
The Navigation Pane contains the set of navigation modules, such as the Mail navigation module, available in Outlook. Each navigation module is represented by a NavigationModule object or by an object derived from the NavigationModule object. The Modules property of the NavigationPane object provides access to the navigation modules contained by the Navigation Pane. You can use the following objects to access the corresponding navigation module:
Navigation Groups and Navigation Folders
Each navigation module contains a set of navigation groups. A navigation group, represented by the NavigationGroup object, is a container for navigation folders. A navigation folder, represented by the NavigationFolder object, provides an access point in the Navigation Pane for a Folder object. You can obtain a NavigationGroup object reference by using the NavigationGroups property of a CalendarModule, ContactsModule, JournalModule, MailModule, NotesModule, or TasksModule object. The Folder List and Shortcuts navigation modules do not contain navigation groups.
You can create and delete custom navigation groups by using the Create and Delete methods, respectively, of the NavigationGroups object. You can identify a custom navigation group by using the GroupType property of the NavigationGroup object to retrieve the navigation group type for the object, and you can retrieve the default navigation group for a specified group type by using the GetDefaultNavigationGroup method of the NavigationGroups object.
Once you have a NavigationGroup object, you can obtain a NavigationFolder object reference by using the NavigationFolders property of the NavigationGroup object. Each NavigationFolder represents a navigation folder associated with a Folder object. You can add navigation folders to a navigation group by using the Add method of the NavigationFolders object. Only one NavigationFolder object can be associated with a Folder object at any given time, so adding a NavigationFolder associated with a given Folder object to a navigation group automatically removes any existing NavigationFolder references associated with that Folder object. You can also delete navigation folders from a navigation group by using the Remove method of the NavigationFolders object, but only if the IsRemovable property is set to True for the NavigationFolder object to be removed. You cannot remove standard navigation folders, such as the Inbox folder, that are defined by Outlook.
|Navigation folders can be freely added to or removed from the Favorite Folders navigation group, a special navigation group contained by the MailModule object, regardless of the IsRemovable property value of the navigation folder.|
Displaying the Navigation Pane
The Navigation Pane can display navigation modules in either normal or collapsed mode. The Visible property of a NavigationModule object determines if the navigation module is displayed in the Navigation Pane, while the order in which visible navigation modules are displayed is determined by the Position property of each NavigationModule object.
You can use the IsCollapsed property to determine which mode is used by the NavigationPane object. In normal mode, the visible navigation modules contained by the Navigation Pane are displayed as a combination of large and small buttons. The number of large buttons displayed in normal mode is determined by the DisplayedModuleCount property. If there are more visible navigation modules than are specified by this property, the remaining visible navigation modules are displayed as small buttons at the bottom of the Navigation Pane. In collapsed mode, the visible navigation modules contained by the Navigation Pane are displayed as small buttons. The number of small buttons displayed in collapsed mode is determined by the DisplayedModuleCount property. If there are more visible navigation modules than are specified by this property, the remaining visible navigation modules are not displayed.
The current navigation module can be changed by setting the CurrentModule property of the NavigationPane object to one of the NavigationModule objects contained by the navigation pane.
Within each navigation module, the Position property of the NavigationGroup object determines the display order of navigation groups. Similarly, the Position property of the NavigationFolder object determines the display order of navigation folders within each navigation group. If a NavigationFolder object represents a calendar folder, then the IsSideBySide property determines if the contents of the calendar folder are displayed in side-by-side or overlay mode.
Handling Navigation Pane Events
The NavigationPane object provides the ModuleSwitch event so that add-ins can identify when the current navigation module changes, either programmatically or by user action, in the Navigation Pane.
The NavigationGroups object provides the NavigationFolderAdd and NavigationFolderRemove events so that add-ins can identify when a navigation folder is added to or removed from a NavigationGroup object in the collection. The NavigationGroups object also provides the SelectedChange event so that add-ins can identify when the IsSelected property for a navigation folder associated with a calendar folder changes, either programmatically or by user action, in the Navigation Pane.