HowTo: Customize Outlook Navigation Pane – C#, VB.NET
What is the Outlook Navigation pane? According to Microsoft, it is the column on the left side of the Outlook window that includes panes such as Shortcuts or Mail and the shortcuts or folders within each pane. The Navigation Pane was introduced in Outlook 2003 and enhanced in Outlook 2007. Let’s see what a developer can do with the Navigation Pane.
Well, in Outlook 2003 the only thing that the developer can do is to switch the Outlook Navigation Pane on and off. Agree, it’s barely sufficient, but that’s the whole of the Outlook 2003 Object model capabilities available for the developer:
Private Sub ButtonVisible_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles ButtonVisible.Click If TryCast(ExplorerObj, Outlook._Explorer). _ IsPaneVisible(Outlook.OlPane.olNavigationPane) Then TryCast(ExplorerObj, Outlook._Explorer).ShowPane( _ Outlook.OlPane.olNavigationPane, False) ButtonVisible.Text = "Navigation Pane On" Else TryCast(ExplorerObj, Outlook._Explorer).ShowPane( _ Outlook.OlPane.olNavigationPane, True) ButtonVisible.Text = "Navigation Pane Off" End If End Sub
In this respect, the Object Models of Outlook 2007 and Outlook 2010 offer far more features. Besides the ability to minimize the Navigation pane programmatically, we can switch between navigation modules using the CurrentModule property, manage the folder list in Favorite Folders, create your own groups in all navigation modules except for MailModule module, populate custom NavigationGroup using the NavigationFolders collection.
I am not going to publish the whole code right here, you can download the C# sample and VB.NET sample using the links below. As to the notorious question “How to add a custom button to the bottom of the Navigation Pane?”, the answer is the same as before – there is no way to do it. Even the Outlook 2007 Object Model doesn’t allow this. Probably something will change in the next Microsoft Office version, let’s wait and hope :)
You may also be interested in:
Outlook customization: Reading pane, Outlook bar and To-Do bar
Special features for Outlook plug-in development
Available downloads:
C# sample Outlook add-in for VS 2005
VB.NET sample Outlook add-in for VS 2005
3 Comments
Is it possible to write code with vb.net to add a hyperlink to the Outlook 2019 navigation bar? I have created code with an independent vb.net program that adds an outlook folder under the Inbox. What I really need is for the folder to sink with or shortcut to a windows file folder. The goal is to drag and drop emails to a file storage on the server. A hyperlink would also make this a little easier so that selecting the link in the outlook navigation bar would open the destination windows file folder. Any ideas?
Hello Mark,
To achieve your goal you need to create an Outlook ad-in listening to the ItemAdd event of the Items collection of that folder. When the event occurs, the add-in gets the item added and saves it to the target folder on the file system. Note that the user may drop an Outlook attachment or a file in your folder; the item’s type will be Outlook.DocumentItem in this case. If the user drops an email to your folder, the type will be Outlook.MailItem.
thank you!