• Outlook User
  • New Outlook app
  • Outlook.com
  • Outlook Mac
  • Outlook & iCloud
  • Developer
  • Microsoft 365 Admin
    • Common Problems
    • Microsoft 365
    • Outlook BCM
    • Utilities & Addins

Shortcuts to open Outlook folders

Slipstick Systems

› Developer › Code Samples › Shortcuts to open Outlook folders

Last reviewed on July 24, 2023     22 Comments

The current versions do not support creating shortcuts on your desktop to the Outlook folders. Outlook doesn't support creating shortcuts to folders on the Quick Access toolbar (QAT) or ribbon, but you can put macro on the QAT or ribbon that opens a folder.

But you can create shortcuts to open folders, using one of these options, in my order of preference:

  1. Add the folder to Outlook's Favorites
  2. Use a macro on the QAT or ribbon
  3. Use VBScript or PowerShell to open the folder
  4. Create a shortcut on the Shortcut navigation pane

Tip: Using a shortcut on the Shortcut nav pane is a two-step process, add it to Favorites in Mail instead. The exception would be if you constantly jump between specific folders, including contacts, calendar and tasks and you want a simplified Folder list view

To use these macros

Go to File, Options, Trust Center,Macro Settings and set macro security to low for now. After you are finished creating and testing the macros, you can use Selfcert to sign the macros and change the settings to only signed macros.

  1. Open the VBA editor using Alt+F11
  2. Right-click on Project1 and choose Insert Module
  3. Paste the appropriate macro into the new module
  4. Change the macro name
  5. Correct the folder names as needed
  6. Repeat steps 3, 4, and 5 as needed. You can use one module for all of these macros.

In Outlook:

  1. Go to File, Options
  2. Select Customize Ribbon or Quick Access Toolbar
  3. Select Macros from the Choose Commands From dropdown
  4. If adding it to the ribbon, add a New Group or a New Tab and New Group
  5. Select your macro and click Add

Open a default folder

This code sample opens a default folder, the Junk Email folder in this example.

Sub openJunkFolder()
 Dim objOlApp As Outlook.Application
 Set objOlApp = CreateObject("Outlook.Application")
 Dim objFolder As Outlook.Folder

 Set objFolder = Session.GetDefaultFolder(olFolderJunk)
 
 Set objOlApp.ActiveExplorer.CurrentFolder = objFolder

 Set objFolder = Nothing
 Set objOlApp = Nothing
End Sub

To open Exchange public folders, you'll use the GetDefaultFolder method and to get the olPublicFoldersAllPublicFolders folder type. Walk to subfolders using the same method used for mailbox subfolders.

Set objFolder = Session.GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders("my folder")

Default FolderUse with GetDefaultFolders
InboxolFolderInbox
CalendarolFolderCalendar
ContactsolFolderContacts
TasksolFolderTasks
To-Do ListolFolderToDo
Sent ItemsolFolderSentMail
OutboxolFolderOutbox
NotesolFolderNotes
DraftsolFolderDrafts
Junk EmailolFolderJunk
Deleted ItemsolFolderDeletedItems
All Public FoldersolPublicFoldersAllPublicFolders

Open a subfolder of a default folder

Use this code sample to open a subfolder under one of Outlook's default folders.

Sub openSubFolder()

 Dim objOlApp As Outlook.Application
 Dim objFolder As Outlook.Folder
 Set objOlApp = CreateObject("Outlook.Application")

 Set objFolder = Session.GetDefaultFolder(olFolderInbox).Folders("subfolder name")

 Set objOlApp.ActiveExplorer.CurrentFolder = objFolder

 Set objFolder = Nothing
 Set objOlApp = Nothing

End Sub

To open nested subfolders, add Folders("foldername") as needed:
Set objFolder = Session.GetDefaultFolder(olFolderInbox).Folders("subfolder name").Folders("subfolder name")

Open a folder at the same level as the default folders

This code sample opens a folder at the same level as the Inbox. Add .Folders("Folder name") as needed to locate nested subfolders.

Sub openOtherFolder()

 Dim objOlApp As Outlook.Application
 Dim objFolder As Outlook.Folder
 Set objOlApp = CreateObject("Outlook.Application")

 Set objFolder = Session.GetDefaultFolder(olFolderInbox).Parent.Folders("Subfolder name")

 Set objOlApp.ActiveExplorer.CurrentFolder = objFolder

 Set objFolder = Nothing
 Set objOlApp = Nothing

End Sub

Open a folder in another data file

If you need a shortcut to a folder in another data file, you'll need to use the GetFolderPath function with the data file display name and the path to the folder.

Add the function to the bottom of the module. The one function can be used with any macro that needs it.

Sub openOtherPST()

 Dim objOlApp As Outlook.Application
 Dim objFolder As Outlook.Folder
 Set objOlApp = CreateObject("Outlook.Application")

' Get GetFolderPath Function from http://slipstick.me/qf#GetFolderPath
Set objFolder = GetFolderPath("display-name\Inbox\Test")

Set objOlApp.ActiveExplorer.CurrentFolder = objFolder

Set objFolder = Nothing
Set objOlApp = Nothing

End Sub

 

Use with several folders

If you want to create shortcuts for multiple folders, use this code sample. It's more compact and easier to read compared to repeating the full macros for each folder.

To use these macros, copy the openInbox macro, changing the name and the folder path. Add the open macros to the ribbon or Quick Access toolbar.

Public objfolder As Outlook.MAPIFolder

Sub openInbox()
 Set objfolder = Session.GetDefaultFolder(olFolderInbox)
 openOutlookFolder
End Sub

Sub openTest()
 Set objfolder = Session.GetDefaultFolder(olFolderInbox).Folders("Test")
 openOutlookFolder
End Sub


Private Sub openOutlookFolder()
 Dim objOlApp As Outlook.Application
 Set objOlApp = CreateObject("Outlook.Application")
 Set objOlApp.ActiveExplorer.CurrentFolder = objfolder
 Set objOlApp = Nothing

End Sub

How to use the macros on this page

First: You need to have macro security set to the lowest setting, Enable all macros during testing. The macros will not work with the top two options that disable all macros or unsigned macros. You could choose the option Notification for all macros, then accept it each time you restart Outlook, however, because it's somewhat hard to sneak macros into Outlook (unlike in Word and Excel), allowing all macros is safe, especially during the testing phase. You can sign the macro when it is finished and change the macro security to notify.

To check your macro security in Outlook 2010 and newer, go to File, Options, Trust Center and open Trust Center Settings, and change the Macro Settings. In Outlook 2007 and older, look at Tools, Macro Security.

After you test the macro and see that it works, you can either leave macro security set to low or sign the macro.

Macros that run when Outlook starts or automatically need to be in ThisOutlookSession, all other macros should be put in a module, but most will also work if placed in ThisOutlookSession. (It's generally recommended to keep only the automatic macros in ThisOutlookSession and use modules for all other macros.) The instructions are below.

The macros on this page should be placed in a module.

Open the VBA Editor by pressing Alt+F11 on your keyboard.

To put the code in a module:

  1. Right click on Project1 and choose Insert > Module
  2. Copy and paste the macro into the new module.

More information as well as screenshots are at How to use the VBA Editor

More Information

OlDefaultFolders Enumeration (MSDN)
Working with VBA and non-default Outlook Folders
Folder: Find a folder by its name (VBOffice.net)

Shortcuts to open Outlook folders was last modified: July 24th, 2023 by Diane Poremsky
Post Views: 49

Related Posts:

  • Move Outlook Folders using VBA
  • Open Outlook Folders using PowerShell or VBScript
  • Delete duplicate messages using a macro
  • Working with All Items in a Folder or Selected Items

About 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.

Comments

  1. Pepi Huber says

    June 23, 2020 at 12:29 pm

    Hi Diane, thanks so much, great code. I use it to show a Search Folder. This works well and shows all eMails covered by the search folder.
     
    There is one catch I could not solve. The search folder is not selected in the navigation pane for Mails. When I use Folder view all is fine, the emails show up and the search folder is being selected (visually) in the Folder view. In the Mail view of the navigation pane the eMails show up correctly but the Search folder is not selected - no folder is selected in the navigation pane. I tried to refresh the view from VBA to correctly show the search folder selected in the navigation pane for Mails, but not successful. If you have a hint I would be grateful! Thanks, Pepi

    Reply
    • Diane Poremsky says

      June 23, 2020 at 4:21 pm

      I'll test it and see if i can figure out why it's not working as you expect and if there is a way to fix it.

      Reply
  2. Suborno says

    May 31, 2019 at 11:39 am

    I ran a VB script and folders like Inbox and Archive got hidden.
    Please help with a code to unhide them.

    Reply
  3. Bob Roberts says

    April 22, 2018 at 11:14 pm

    Diane, your site is super!

    Just what I needed, again; "Open a folder at the same level as the default folders"

    There have been other times when I was lost in the woods and your guidance was spot on.

    Thank you,
    Bob

    Reply
  4. Robert R says

    February 7, 2017 at 8:57 am

    Sorry, I misspoke ... the nested folder resides in a Outlook Personal Archive (not an .ost file). The archive path is "\Archive_MktProjects". Thanks in advance.

    Reply
    • Diane Poremsky says

      April 3, 2017 at 12:33 am

      Sorry I missed this earlier - i was swamped and am now trying to get caught up. It doesn't matter what the data type is, only if its in the default data file or in a different file - if its not in the default, you need to use the getfolderpath function.
      https://www.slipstick.com/developer/working-vba-nondefault-outlook-folders/#GetFolderPath

      Reply
  5. Robert R says

    February 7, 2017 at 8:20 am

    Hi there, can you help me to modify your code to access a nested folder in an .ost archive file (my nested folder does not reside within the inbox folder)?

    Reply
    • Diane Poremsky says

      April 3, 2017 at 12:31 am

      If it's not in the default data file, you need to use
      Set objFolder = GetFolderPath("Archive_MktProjects\folder-name")
      You need the getfolderpath function from https://www.slipstick.com/developer/working-vba-nondefault-outlook-folders/#GetFolderPath

      Reply
  6. Paul says

    January 11, 2017 at 5:34 am

    Hello. I have been looking at your macros but unfortunately none are adapted to what I need. I would need to open through the ribbon one or several data files that are NOT currently loaded in outlook and that are located in a non-default location. How would I do that?

    Note: The data files are purposely not loaded when outlook launches as those data files are archives and I do not want them to be loaded each time outlook starts. I only need them when it is required through a shortcut in the ribbon. I know there is a command called "Open Outlook Data Files..." but that command seems to be hard coded with the default path C:Users[user_account]DocumentsOutlook Files so it is useless to me.

    Thanks in advance for the help.

    Reply
  7. bhavani says

    March 28, 2016 at 4:36 pm

    I have a requirement wherein i have 10 mail accounts. I want the COLLAPSE VIEW of the Mailboxes itself which is not there in outlook now. Even if i make fvavorites its only Inbox, outbox which is very cumbersome. I want collapse and expand view of hte mail accounts themselves so that when we want to click that mailbox it gives that view only. now we have to navigate very deep deeper until we reach our mailbox acct. Hope somebody can help. I am even ready to pay a small token fee for htis. in outlook. pls help

    Reply
  8. Simon says

    January 29, 2016 at 12:26 am

    Thanks for the article Diane.

    Do you know if this code can be modified to navigate to search folders?

    Thanks,

    Simon

    Reply
    • Diane Poremsky says

      January 29, 2016 at 2:39 pm

      No, i don't think so - search folders are virtual folder and don't have a path like other folders. But I'll take a look and see if there is a way to do it.

      Reply
      • Lukas says

        October 24, 2016 at 3:22 pm

        Diane, did you find a way to create shortcuts for searching folders ?

      • Diane Poremsky says

        October 24, 2016 at 4:36 pm

        No, i haven't found a way to do that. Sorry.

      • Lukas says

        October 25, 2016 at 4:15 pm

        Taht's pitty. Anyway thank you for the response and greetings from Poland.

  9. Geoff says

    April 1, 2015 at 9:31 am

    I Diane, thanks for your follow up message.
    I did get it working shortly after my earlier posts as I found I had a typo in my code of the folder name.
    I thank you very much for this code as it helped me greatly.
    Best Regards
    Geoff

    Reply
  10. Geoff says

    February 24, 2015 at 5:45 am

    Hi Diane, thank you for your reply.
    I want to access a folder in a shared mailbox. That is, a folder in a Group Mailbox, that everybody thats been given permission can access. I dont know another way to explain it.
    I can see here that Calender is considered a folder however I never considered it as that. To me folders are like the directory structure of Windows Explorer, and we set up a similar thing in Outlook with Sub-folders for storing emails by category etc. Calender is just a different part of outlook but not a folder.
    I digress.
    Anyway, with some trial and error I was able to get it working to access some Group mailboxes and sub folders using the scrip above you posted with the Function GetFolderPath
    However its not working for personal folders I have on my D drive and I can't figure out which example script would best fit this case.

    I tried...

    Open a folder in another data file

    If you need a shortcut to a folder in another data file, you'll need to use the GetFolderPath function with the data file display name and the path to the folder.

    Add the function to the bottom of the module. The one function can be used with any macro that needs it.
    Sub openOtherPST()

    Dim objOlApp As Outlook.Application
    Dim objFolder As Outlook.Folder
    Set objOlApp = CreateObject("Outlook.Application")

    ' Get GetFolderPath Function from http://slipstick.me/qf#GetFolderPath
    Set objFolder = GetFolderPath("display-name\Inbox\Test")

    Set objOlApp.ActiveExplorer.CurrentFolder = objFolder

    Set objFolder = Nothing
    Set objOlApp = Nothing

    End Sub

    with the GetFolderPath function I already have for accessing the Group folders but it gives an error which I can't remember at the moment cause I'm finished for the day. I will try again and note the error here tomorrow.

    Thankyou for your dedicated assistance.
    Geoff

    Reply
    • Diane Poremsky says

      April 1, 2015 at 12:41 am

      GetFolderpath works with pst files. As long as the pst name and folder path is correct - display-name\Inbox\Test - it'll work. I'm not sure why it's not working for you

      Reply
  11. Geoff says

    February 23, 2015 at 6:40 am

    Hi Diane, I've recently upgraded to Office 2013 and the text input of the Goto dialogue (Office 2007) is no longer available. I've used your code to make Quick Access shortcuts to some local folders but I'm unable to get it working for Group folders. I need to make a shortcut to goto a folder called \\Mailbox - ! Customer Number Range Management\ISDN30

    I think your scripts look exactly what I'm looking for to restore some funcanality I've lost.

    I tried this...

    Open a folder in another data file

    If you need a shortcut to a folder in another data file, you'll need to use the GetFolderPath function with the data file display name and the path to the folder.

    Add the function to the bottom of the module. The one function can be used with any macro that needs it.
    Sub openOtherPST()

    Dim objOlApp As Outlook.Application
    Dim objFolder As Outlook.Folder
    Set objOlApp = CreateObject("Outlook.Application")

    ' Get GetFolderPath Function from http://slipstick.me/qf#GetFolderPath
    Set objFolder = GetFolderPath("display-name\Inbox\Test")

    Set objOlApp.ActiveExplorer.CurrentFolder = objFolder

    Set objFolder = Nothing
    Set objOlApp = Nothing

    End Sub

    but I think it needs to be used with this...

    Use a shared folder (Exchange mailbox)

    To access a shared folder in another user's Exchange server mailbox, you need to use GetSharedDefaultFolder to reference the mailbox, after resolving the address to the folder.

    You can use the mailbox owner's display name, alias, or email address when resolving the recipient.
    Dim NS As Outlook.NameSpace
    Dim objOwner As Outlook.Recipient

    Set NS = Application.GetNamespace("MAPI")
    Set objOwner = NS.CreateRecipient("maryc")
    objOwner.Resolve

    If objOwner.Resolved Then
    'MsgBox objOwner.Name
    Set newCalFolder = NS.GetSharedDefaultFolder(objOwner, olFolderCalendar)
    End If

    I can't see how Calender is relevant so its confusing me. I want to make quick access shortcuts to quickly goto the various email folders I work from.
    Could you assist me to get this working please?
    Best regards
    Geoff

    Reply
    • Diane Poremsky says

      February 23, 2015 at 11:52 pm

      For other folders, you need to change this line:
      Set newCalFolder = NS.GetSharedDefaultFolder(objOwner, olFolderCalendar)
      to use the correct folder.

      Is the folder in your profile as a shared mailbox or open as a shared folder?

      Reply
      • Diane Poremsky says

        February 23, 2015 at 11:58 pm

        If this mailbox is open as a shared mailbox, this should work (it does here - I'm caching shared folders)
        Sub openOtherPST()
        Dim objOlApp As Outlook.Application
        Dim objFolder As Outlook.Folder
        Set objOlApp = CreateObject("Outlook.Application")
        ' Get GetFolderPath Function from http://slipstick.me/qf#GetFolderPath
        Set objFolder = GetFolderPath("Mailbox - ! Customer Number Range Management\ISDN30")
        Set objOlApp.ActiveExplorer.CurrentFolder = objFolder
        Set objFolder = Nothing
        Set objOlApp = Nothing

        End Sub

        if you want to open it in a new window, use
        objFolder.Display instead if the currentfolder line.

  12. Anton M says

    June 4, 2014 at 8:39 am

    Thank you, very useful!

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Visit Slipstick Forums.
What's New at Slipstick.com

Latest EMO: Vol. 31 Issue 5

Subscribe to Exchange Messaging Outlook






Support Services

Do you need help setting up Outlook, moving your email to a new computer, migrating or configuring Office 365, or just need some one-on-one assistance?

Our Sponsors

CompanionLink
ReliefJet
  • Popular
  • Latest
  • Week Month All
  • Jetpack plugin with Stats module needs to be enabled.
  • Sync Issues and Errors with Gmail and Yahoo accounts
  • Error Opening iCloud Appointments in Classic Outlook
  • Opt out of Microsoft 365 Companion Apps
  • Mail Templates in Outlook for Windows (and Web)
  • Urban legend: Microsoft Deletes Old Outlook.com Messages
  • Buttons in the New Message Notifications
  • Move Deleted Items to Another Folder Automatically
  • Open Outlook Templates using PowerShell
  • Count and List Folders in Classic Outlook
  • Google Workspace and Outlook with POP Mail
Ajax spinner

Recent Bugs List

Microsoft keeps a running list of issues affecting recently released updates at Fixes or workarounds for recent issues in classic Outlook (Windows).

For new Outlook for Windows: Fixes or workarounds for recent issues in new Outlook for Windows .

Outlook for Mac Recent issues: Fixes or workarounds for recent issues in Outlook for Mac

Outlook.com Recent issues: Fixes or workarounds for recent issues on Outlook.com

Office Update History

Update history for supported Office versions is at Update history for Office

Outlook Suggestions and Feedback

Outlook Feedback covers Outlook as an email client, including Outlook Android, iOS, Mac, and Windows clients, as well as the browser extension (PWA) and Outlook on the web.

Outlook (new) Feedback. Use this for feedback and suggestions for Outlook (new).

Use Outlook.com Feedback for suggestions or feedback about Outlook.com accounts.

Other Microsoft 365 applications and services




New Outlook Articles

Sync Issues and Errors with Gmail and Yahoo accounts

Error Opening iCloud Appointments in Classic Outlook

Opt out of Microsoft 365 Companion Apps

Mail Templates in Outlook for Windows (and Web)

Urban legend: Microsoft Deletes Old Outlook.com Messages

Buttons in the New Message Notifications

Move Deleted Items to Another Folder Automatically

Open Outlook Templates using PowerShell

Count and List Folders in Classic Outlook

Google Workspace and Outlook with POP Mail

Newest Code Samples

Open Outlook Templates using PowerShell

Count and List Folders in Classic Outlook

Insert Word Document into Email using VBA

Warn Before Deleting a Contact

Use PowerShell to Delete Attachments

Remove RE:, FWD:, and Other Prefixes from Subject Line

Change the Mailing Address Using PowerShell

Categorize @Mentioned Messages

Send an Email When You Open Outlook

Delete Old Calendar Events using VBA

VBA Basics

How to use the VBA Editor

Work with open item or selected item

Working with All Items in a Folder or Selected Items

VBA and non-default Outlook Folders

Backup and save your Outlook VBA macros

Get text using Left, Right, Mid, Len, InStr

Using Arrays in Outlook macros

Use RegEx to extract message text

Paste clipboard contents

Windows Folder Picker

Custom Forms

Designing Microsoft Outlook Forms

Set a custom form as default

Developer Resources

Developer Resources

Developer Tools

VBOffice.net samples

SlovakTech.com

Outlook MVP David Lee

Repair PST

Convert an OST to PST

Repair damaged PST file

Repair large PST File

Remove password from PST

Merge Two Data Files

Sync & Share Outlook Data

  • Share Calendar & Contacts
  • Synchronize two computers
  • Sync Calendar and Contacts Using Outlook.com
  • Sync Outlook & Android Devices
  • Sync Google Calendar with Outlook
  • Access Folders in Other Users Mailboxes

Diane Poremsky [Outlook MVP]

Make a donation

Mail Tools

Sending and Retrieval Tools

Mass Mail Tools

Compose Tools

Duplicate Remover Tools

Mail Tools for Outlook

Online Services

Calendar Tools

Schedule Management

Calendar Printing Tools

Calendar Reminder Tools

Calendar Dates & Data

Time and Billing Tools

Meeting Productivity Tools

Duplicate Remover Tools

Productivity

Productivity Tools

Automatic Message Processing Tools

Special Function Automatic Processing Tools

Housekeeping and Message Management

Task Tools

Project and Business Management Tools

Choosing the Folder to Save a Sent Message In

Run Rules on messages after reading

Help & Suggestions

Submit Outlook Feature Requests

Slipstick Support Services

Buy Microsoft 365 Office Software and Services

Visit Slipstick Forums.

What's New at Slipstick.com

Home | Outlook User | Exchange Administrator | Office 365 | Outlook.com | Outlook Developer
Outlook for Mac | Common Problems | Utilities & Addins | Tutorials
Outlook & iCloud Issues | Outlook Apps
EMO Archives | About Slipstick | Slipstick Forums
Submit New or Updated Outlook and Exchange Server Utilities

Send comments using our Feedback page
Copyright © 2026 Slipstick Systems. All rights reserved.
Slipstick Systems is not affiliated with Microsoft Corporation.