• 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

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.

Subscribe
Notify of
22 Comments
newest
oldest most voted
Inline Feedbacks
View all comments

Pepi Huber (@guest_215467)
June 23, 2020 12:29 pm
#215467

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

0
0
Reply
Diane Poremsky(@diane-poremsky)
Author
Reply to  Pepi Huber
June 23, 2020 4:21 pm
#215473

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.

0
0
Reply
Suborno (@guest_213342)
May 31, 2019 11:39 am
#213342

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

0
0
Reply
Bob Roberts (@guest_210926)
April 22, 2018 11:14 pm
#210926

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

0
0
Reply
Robert R (@guest_204409)
February 7, 2017 8:57 am
#204409

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.

0
0
Reply
Diane Poremsky(@diane-poremsky)
Author
Reply to  Robert R
April 3, 2017 12:33 am
#205663

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

0
0
Reply
Robert R (@guest_204408)
February 7, 2017 8:20 am
#204408

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)?

0
0
Reply
Diane Poremsky(@diane-poremsky)
Author
Reply to  Robert R
April 3, 2017 12:31 am
#205662

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

0
0
Reply
Paul (@guest_203848)
January 11, 2017 5:34 am
#203848

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.

0
0
Reply
bhavani (@guest_197491)
March 28, 2016 4:36 pm
#197491

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

0
0
Reply
Simon (@guest_196179)
January 29, 2016 12:26 am
#196179

Thanks for the article Diane.

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

Thanks,

Simon

0
0
Reply
Diane Poremsky(@diane-poremsky)
Author
Reply to  Simon
January 29, 2016 2:39 pm
#196189

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.

1
0
Reply
Lukas (@guest_202510)
Reply to  Diane Poremsky
October 24, 2016 3:22 pm
#202510

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

0
0
Reply
Diane Poremsky(@diane-poremsky)
Author
Reply to  Lukas
October 24, 2016 4:36 pm
#202513

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

0
0
Reply
Lukas (@guest_202536)
Reply to  Diane Poremsky
October 25, 2016 4:15 pm
#202536

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

0
0
Reply

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

Latest EMO: Vol. 30 Issue 15

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
  • Use Classic Outlook, not New Outlook
  • How to Remove the Primary Account from Outlook
  • Disable "Always ask before opening" Dialog
  • Adjusting Outlook's Zoom Setting in Email
  • This operation has been cancelled due to restrictions
  • Remove a password from an Outlook *.pst File
  • Reset the New Outlook Profile
  • Maximum number of Exchange accounts in an Outlook profile
  • Save Attachments to the Hard Drive
  • How to Hide or Delete Outlook's Default Folders
  • Google Workspace and Outlook with POP Mail
  • Import EML Files into New Outlook
  • Opening PST files in New Outlook
  • New Outlook: Show To, CC, BCC in Replies
  • Insert Word Document into Email using VBA
  • Delete Empty Folders using PowerShell
  • Warn Before Deleting a Contact
  • Classic Outlook is NOT Going Away in 2026
  • Use PowerShell to Delete Attachments
  • Remove RE:, FWD:, and Other Prefixes from Subject Line
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

Google Workspace and Outlook with POP Mail

Import EML Files into New Outlook

Opening PST files in New Outlook

New Outlook: Show To, CC, BCC in Replies

Insert Word Document into Email using VBA

Delete Empty Folders using PowerShell

Warn Before Deleting a Contact

Classic Outlook is NOT Going Away in 2026

Use PowerShell to Delete Attachments

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

Newest Code Samples

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

Use PowerShell or VBA to get Outlook folder creation date

Rename Outlook Attachments

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 © 2025 Slipstick Systems. All rights reserved.
Slipstick Systems is not affiliated with Microsoft Corporation.

wpDiscuz

Sign up for Exchange Messaging Outlook

Our weekly Outlook & Exchange newsletter (bi-weekly during the summer)






Please note: If you subscribed to Exchange Messaging Outlook before August 2019, please re-subscribe.

Never see this message again.

You are going to send email to

Move Comment