Always open Contacts to a specific Contacts folder

Last reviewed on December 18, 2013

This code is based off of the macro used to always use the Tasks folder, not the To-Do List, when you switch folders in Outlook.

Contacts indexUse to it always open a specific folder when switching to the Contacts (or People) module.

To select a specific folder in the list, change the number in this line to open a different folder. For example, the code below opens the 4th folder in the My Contacts group as seen in the screenshot.

     Set objGroup = objModule.NavigationGroups("My Contacts")
     Set objNavFolder = objGroup.NavigationFolders.Item(4)

Select folder macro

Dim WithEvents objPane As NavigationPane
Private Sub Application_Startup()
    Set objPane = Application.ActiveExplorer.NavigationPane
End Sub
Private Sub objPane_ModuleSwitch(ByVal CurrentModule As NavigationModule)
  Dim objModule As ContactsModule
  Dim objGroup As NavigationGroup
  Dim objNavFolder As NavigationFolder
 If CurrentModule.NavigationModuleType = olModuleContacts Then
     Set objModule = objPane.Modules.GetNavigationModule(olModuleContacts)

' Use the Group name the folder is in
     Set objGroup = objModule.NavigationGroups("My Contacts")

' Replace 4 with the index number of the folder you want to use
     Set objNavFolder = objGroup.NavigationFolders.Item(4)
     objNavFolder.IsSelected = True
  End If
  Set objNavFolder = Nothing
  Set objGroup = Nothing
  Set objModule = Nothing
 End Sub

Opening specific folders in other navigation panes

You can use this method to default to a specific folder in other navigation panes.

ModuleDim objModule As ?olModule?

Replace the group name and index number with the group name the folder is in and it's position within the group.

Note: Mail works with the Favorites list.

Written by

Diane Poremsky
A Microsoft Outlook Most Valuable Professional (MVP) since 1999, Diane is the author of several books, including Outlook 2013 Absolute Beginners Book. She also created video training CDs and online training classes for Microsoft Outlook. You can find her helping people online in Outlook Forums as well as in the Microsoft Answers and TechNet forums.

If the Post Coment button disappears, press your Tab key.