How to: Add a Custom Folder to a Group and Display it in Overlay Mode by Default
|Outlook Developer Reference|
You can add custom navigation folders to a navigation group in Microsoft Office Outlook 2007 by using the Add method of the NavigationFolders collection for a NavigationGroup object. The Add method accepts a Folder object reference, to which the custom navigation folder is associated.
If the custom navigation folder is associated with a calendar folder, you can also use the IsSideBySide property of the NavigationFolder object to determine if the contents of the custom navigation folder are displayed in side-by-side or overlay mode.
This sample creates a new calendar folder for company events and adds a custom navigation folder for the new folder, configuring the custom navigation folder so that it is displayed by default in overlay mode.
The sample performs the following actions:
- The sample obtains a Folder object reference for the Calendar default folder for the current user, by using the GetDefaultFolder method of the NameSpace object.
- It then creates a new Folder object named "Company Events", representing the new calendar folder, in the Folders collection of the Calendar default folder.
- The sample then obtains a reference to the NavigationPane object for the active explorer and uses the GetNavigationModule method of the NavigationModules collection to obtain a CalendarModule object reference.
- It then uses the GetDefaultNavigationGroup method of the NavigationGroups collection for the CalendarModule to obtains a NavigationGroup object reference to the My Calendars navigation group.
- It then adds a new NavigationFolder object, based on the Folder object created earlier by the sample, to the navigation group by using the Add method of the NavigationGroups collection for that navigation group.
- The sample then sets the CurrentModule property of the NavigationPane object to the CalendarModule object reference, to ensure that the Calendar navigation module is currently displayed in the Navigation Pane.
- Finally, the sample then configures the navigation folder:
- The sample sets the IsSelected property to True to display it in the active explorer.
- The sample then sets the IsSideBySide property to False to display it by default in overlay mode.