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

Select Multiple Calendars in Outlook

Slipstick Systems

› Developer › Code Samples › Select Multiple Calendars in Outlook

Last reviewed on September 16, 2019     31 Comments

Applies to: Outlook (classic), Outlook 2007, Outlook 2010

Use this macro to select multiple calendars and open them in overlay mode. If you are using iCloud and don't want the iCloud calendars selected by default, you can use this method to deselect the iCloud calendars. See Deselect iCloud Calendars for more information and the necessary code.

This code sample assumes that the calendars are all in the My Calendars group.
Use VBA to select calendars

If the calendars are all in another group, you can use this line to identify the group and select the calendars in it:
Set objGroup = .Item("group name")

In this code sample, I'm opening calendars #1, 3, and 4 in the My Calendars group. To open 2 and 5 (New Stuff and a mailbox Calendar in the screenshot), I'd use Case 2, 5

When you use Outlook 2013 and all of the calendars are in one group, you can select the group to show all.

To use, set macro security to low, open the VBA editor by pressing Alt+F11 then paste this into a new module. Assign it to a ribbon or toolbar button and run. More complete instructions are at How to use the VBA Editor.

To use a specific view, see set a view at the end of this article.

Sub SelectCalendars()
    Dim objPane As Outlook.NavigationPane
    Dim objModule As Outlook.CalendarModule
    Dim objGroup As Outlook.NavigationGroup
    Dim objNavFolder As Outlook.NavigationFolder
    Dim objCalendar As Folder
    Dim objFolder As Folder
    
    Dim i As Integer
    
    Set Application.ActiveExplorer.CurrentFolder = Session.GetDefaultFolder(olFolderCalendar)
    DoEvents
    
    Set objCalendar = Session.GetDefaultFolder(olFolderCalendar)
    Set objPane = Application.ActiveExplorer.NavigationPane
    Set objModule = objPane.Modules.GetNavigationModule(olModuleCalendar)
    
    With objModule.NavigationGroups
        Set objGroup = .GetDefaultNavigationGroup(olMyFoldersGroup)

    ' To use a different group
       ' Set objGroup = .Item("group name")
    End With

    For i = 1 To objGroup.NavigationFolders.Count
        Set objNavFolder = objGroup.NavigationFolders.Item(i)
        Select Case i

        ' Enter the calendar index numbers you want to open
            Case 1, 3, 4
                objNavFolder.IsSelected = True
             
        ' Set to True to open side by side
                objNavFolder.IsSideBySide = False
            Case Else
                objNavFolder.IsSelected = False
        End Select
    Next

' set the view here

    Set objPane = Nothing
    Set objModule = Nothing
    Set objGroup = Nothing
    Set objNavFolder = Nothing
    Set objCalendar = Nothing
    Set objFolder = Nothing
End Sub

 

Automatically select specific calendars when switching to the calendar module

If you want to always have certain calendars selected when you switch to the calendar module, you can add an Application_Startup macro to the code. Every time you select the calendar module, the calendars listed in the Case statement will be selected.

To use this macro, add it to ThisOutlookSession. Click in the Application_Startup macro and press Run to enable it without restarting Outlook.

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 objPane As NavigationPane
    Dim objModule As CalendarModule
    Dim objGroup As NavigationGroup
    Dim objNavFolder As NavigationFolder
    Dim objCalendar As Folder
    Dim objFolder As Folder
     
    Dim i As Integer
     
    If CurrentModule.NavigationModuleType = olModuleCalendar Then
    Set Application.ActiveExplorer.CurrentFolder = Session.GetDefaultFolder(olFolderCalendar)
    DoEvents
     
    Set objCalendar = Session.GetDefaultFolder(olFolderCalendar)
    Set objPane = Application.ActiveExplorer.NavigationPane
    Set objModule = objPane.Modules.GetNavigationModule(olModuleCalendar)
     
    With objModule.NavigationGroups
        Set objGroup = .GetDefaultNavigationGroup(olMyFoldersGroup)
 
    ' To use a different group
       ' Set objGroup = .Item("group name")
    End With
 
    For i = 1 To objGroup.NavigationFolders.Count
        Set objNavFolder = objGroup.NavigationFolders.Item(i)
        Select Case i
 
        ' Enter the calendar index numbers you want to open
            Case 1, 3, 4
                objNavFolder.IsSelected = True
              
        ' Set to True to open side by side
                objNavFolder.IsSideBySide = False
            Case Else
                objNavFolder.IsSelected = False
        End Select
    Next

' set the view here

    End If

    Set objPane = Nothing
    Set objModule = Nothing
    Set objGroup = Nothing
    Set objNavFolder = Nothing
    Set objCalendar = Nothing
    Set objFolder = Nothing

End Sub

 

Select Specific Calendar When Outlook Starts

Outlook is starting with the user's Calendar and not the one we want selected.

If the calendar is in an account in your profile, you can select the calendar in File, Options, Advanced and select it as the startup folder. If it's not available to select, you might be able to use a command line switch to choose the correct calendar. See "Choose the Folder Outlook Starts Up In" for details.

This code selects a specific calendar when Outlook starts up. You need to set Outlook to start in the Calendar folder for it to work.

Private Sub Application_Startup()
  Dim objPane As NavigationPane
  Dim objModule As CalendarModule
  Dim objGroup As NavigationGroup
  Dim objNavFolder As NavigationFolder
 
  Set objPane = Application.ActiveExplorer.NavigationPane
  Set objModule = objPane.Modules.GetNavigationModule(olModuleCalendar)
 
  With objModule.NavigationGroups
  Set objGroup = .GetDefaultNavigationGroup(olMyFoldersGroup)
  End With
     On Error Resume Next
   Set objNavFolder = objGroup.NavigationFolders.Item(2)
       DoEvents
   objNavFolder.IsSelected = True
   objNavFolder.IsSideBySide = False
     DoEvents
   Set objNavFolder = objGroup.NavigationFolders.Item(1)
     objNavFolder.IsSelected = False

'set the view here

End Sub

 

Deselect iCloud Calendars

Many iCloud users don't appreciate that Apple has all iCloud calendars selected by default when you open Outlook. If you are one of these users, you can use the following code sample to deselect the iCloud calendars. Replace the block of code between With objModule.NavigationGroups and the last End If in the automatic macro above with the code below.

    With objModule.NavigationGroups
        Set objGroup = .Item("iCloud")
    End With
  
    For i = 1 To objGroup.NavigationFolders.Count
        Set objNavFolder = objGroup.NavigationFolders.Item(i)
        Select Case i
  
        ' Enter the calendar index numbers you want to close
            Case 1, 2
             If objNavFolder.IsSelected = True Then
                objNavFolder.IsSelected = False
             Else
             End If
        ' we'll deselect any we missed
           Case Else
               objNavFolder.IsSelected = False
        End Select
    Next

End If

 

Set a specific view on the Calendar

Outlook will generally use the last view you used on the calendar. If you want to use a specific view with the macros above, you can set the view in the code.

Add this code before the end of the macros above to set the calendar to the day view. If the macro has an End if at the end, add it before the End If.

 Dim objViews As Views
 Dim objView As View
 
Set objViews =  Application.ActiveExplorer.CurrentFolder.Views
 Set objView = objViews.Item("Calendar")
  With objView
      ' Set the calendar view to show a
      ' single day.
      .CalendarViewMode = olCalendarViewDay
  End With

 objView.Apply

NameDescription
olCalendarView5DayWeekDisplays a 5-day week.
olCalendarViewDayDisplays a single day.
olCalendarViewMonthDisplays a month.
olCalendarViewMultiDayDisplays a number of days equal to the DaysInMultiDayMode property value of the CalendarView object.
olCalendarViewWeekDisplays a 7-day week.

More Information

How to: Add a Custom Folder to a Group and Display it in Overlay Mode by Default (MSDN)
Macro code that displays several shared calendars (Outlookcode.com)

Select Multiple Calendars in Outlook was last modified: September 16th, 2019 by Diane Poremsky

Related Posts:

  • Always open Contacts to a specific Contacts folder
  • Combine and Print Multiple Outlook Calendars
  • Apply a View to a Folder using a Macro
  • Search Calendars for Appointments

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
31 Comments
newest
oldest most voted
Inline Feedbacks
View all comments

Ty S
November 16, 2023 9:47 am

I am selecting 15 calendars under a "shared calendars" group and that is working. But by default it is selecting them all under both my default calendar and schedule view. I then have to toggle day view and Schedule View to get the stacked one to go away. Screenshot here.

Is there a way that I can choose Schedule View by default?

0
0
Reply
Keith Collyer
October 24, 2022 9:04 am

I've successfully used this code to open all my calendars in one overlaid weekly view. What I haven't managed to do is to get Outlook to set the specific calendar to use for New Appointment or New Meeting. Which calendar gets chosen seems almost random, though it seems to be consistent after an application of the macro it may change on the next application.
Ideally, I want the New ... functions to default to my personal calendar.

0
0
Reply
Walt Bilofsky
March 14, 2021 5:38 pm

Diane,

Thanks so much for "Automatically select specific calendars when switching to the calendar module." It does a great job of displaying my three calendars (two shared) in one.
I have two questions:

1) With Outlook set to start in Calendar, it only displays Calendar on startup. My workaround is to start in Contacts and switch to Calendar. But is there a way to force objPane_ModuleSwitch to run on startup?

2) The first time the calendars are displayed, the third one is selected. Every time after that it's the first one. How can the first one be selected all the time?
I tried

  For i = objGroup.NavigationFolders.Count To 1 Step -1

but then the second folder was selected the first time; still the first one after that.

Best,

Walt

0
0
Reply
Keith Collyer
Reply to  Walt Bilofsky
October 24, 2022 11:48 am

Just realised my question is essentially the same as the second question here.

0
0
Reply
247it
September 21, 2020 9:44 am

Hi,

what code can I use after the calendar selection to just go (back) to the default inbox email folder? I'm now in the calendar view.

BR

0
0
Reply
Diane Poremsky
Author
Reply to  247it
September 21, 2020 10:00 am

You'll add a line to change the module to olModuleMail - add it at the end and it should move you back to the mail module. (I'll test it to verify)

Set objModule = objPane.Modules.GetNavigationModule(olModuleMail)

0
0
Reply
Diane Poremsky
Author
Reply to  Diane Poremsky
September 21, 2020 10:45 am

First bug: you need to either use a new object name or change the DIM:
 Dim objModule 'As CalendarModule

Beyond that, I'm still getting errors if I try to set a calendar format then switch back using code.

0
0
Reply
Jerry
August 12, 2017 3:35 pm

I need some help if possible. I use Outlook 2016 running on an Intel compute stick hooked up to a 65" TV. I want Outlook to open and display 3 Internet calendars (Google Calendars ics) in column view. I used the code above such that when I select the calendar icon in Outlook all 3 calendars open perfectly. However, the last part I'm stuck on is how to I get Outlook to open in that view by default, that is, startup and automatically display the 3 calendars. I can select one Internet calendar to open in the advanced options but not all 3 at once. Can this be achieved by coding?

Thanks,
Jerry

0
0
Reply
Diane Poremsky
Author
Reply to  Jerry
August 16, 2017 11:12 am

I have never tried it, but it should work. (It actually should remember the last selected calendars (assuming outlook closes correctly and doesn't crash), if you started in email or outlook today and switched to the calendar manually.)
From https://www.slipstick.com/developer/code-samples/select-multiple-calendars-outlook/#start
This set of lines opens the second group:
Set objNavFolder = objGroup.NavigationFolders.Item(2)
DoEvents
objNavFolder.IsSelected = True
objNavFolder.IsSideBySide = False
DoEvents

if the calendars are all in that group, they should open, otherwise, copy those lines and change the group #.
if they aren't in the same group, then you can merge parts of the first macro with this.

0
0
Reply
max
December 22, 2016 4:55 pm

Diane,

sorry this is the correct question. ignore previous.
thanks for the writeup. have been using for a while. outlook must have auto-updated. now get a compile error on
Set objCalendar = Session.GetDefaultFolder(olFolderCalendar)
error = obect library feature not supported.
an you help ? thanks

0
0
Reply
max
December 22, 2016 4:53 pm

Diane,

thanks for the writeup. have been using for a while. outlook must have auto-updated. now get a compile error on
Set objModule = objPane.Modules.GetNavigationModule(olModuleCalendar)
error = obect library feature not supported.
an you help ? thanks

0
0
Reply
Lane Jacobs
April 5, 2016 8:40 pm

Hey Diane!

How might this look different if I wanted to select a calendar based on its name?

Thanks!

0
0
Reply
Diane Poremsky
Author
Reply to  Lane Jacobs
April 5, 2016 10:41 pm

you can replace the index number with a name but if it's not in the default group you need to set the group it's in.

With objModule.NavigationGroups
' Set objGroup = .GetDefaultNavigationGroup(olMyFoldersGroup)
Set objGroup = .Item("group name")
End With

Set objNavFolder = objGroup.NavigationFolders.Item("Alpha")
objNavFolder.IsSelected = True
objNavFolder.IsSideBySide = False

0
0
Reply
Lane
Reply to  Diane Poremsky
April 11, 2016 6:29 pm

Sorry to bother again!

I had set the correct group I wanted the code to grab the calendar from - however upon strictly replacing the index number with a name - I received some errors :( Below is the part of code I would have changed.

For i = 1 To objGroup.NavigationFolders.Count
Set objNavFolder = objGroup.NavigationFolders.Item(i)
Select Case i

' Enter the calendar index numbers you want to open
Case Room 01 100
objNavFolder.IsSelected = True

I'm sure I've done something incorrectly, or that I've perhaps misread your instructions. Did I replace the index number with the name incorrectly?

0
0
Reply

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

Latest EMO: Vol. 30 Issue 29

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.
  • Open Outlook Templates using PowerShell
  • Count and List Folders in Classic Outlook
  • 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
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

Open Outlook Templates using PowerShell

Count and List Folders in Classic Outlook

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

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

:wpds_smile::wpds_grin::wpds_wink::wpds_mrgreen::wpds_neutral::wpds_twisted::wpds_arrow::wpds_shock::wpds_unamused::wpds_cool::wpds_evil::wpds_oops::wpds_razz::wpds_roll::wpds_cry::wpds_eek::wpds_lol::wpds_mad::wpds_sad::wpds_exclamation::wpds_question::wpds_idea::wpds_hmm::wpds_beg::wpds_whew::wpds_chuckle::wpds_silly::wpds_envy::wpds_shutmouth:
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