Outlook 365 How to show all calendars at startup?

nao

Member
Outlook version
Outlook 365 64 bit
Email Account
Exchange Server
There are three calendars in the "My Calendars" group.
I would like to show all calendars at startup with the default calendar, Calendar 1, active.
To do this, I use the following VBA code, but there are two problems.

One problem is that a part of the code is redundant, which makes it time-consuming.
By default, Calendar1 in My Calendars group is visible after startup.
To show all calendars, the code makes Calendar2 and Calendar3 visible.
After running these commands, Calendar3 is active.
To activate Calendar1 after startup, the code makes Calendar1 invisible and then visible.

I think, instead of this, it's an efficient way to use the command corresponding to check the checkbox of "My Calendars" in the navigation pane.
But I don't know how to do this.

The other problem is that, after startup using this macro, I can't switch day view and month view by shortcut keys, Cntl+Alt+1 and Cntl+Alt+2.
I think the way to check the check of "My Calendars" solves this problem
because I can switch these views by the shortcut keys when I manually check the checkbox.

So could you tell me the way to solve these problems?
Thank you in advance.

Private WithEvents g_Items As Outlook.Items

Private Sub Application_Startup()
Dim Ns As Outlook.NameSpace

Set Ns = Application.GetNamespace("MAPI")
Set g_Items = Ns.GetDefaultFolder(olFolderCalendar).Items

setupInitialDisplayCalendars
End Sub

Public Sub setupInitialDisplayCalendars()

Dim navModCal As CalendarModule
Dim navGroup As NavigationGroup

Set navModCal = ActiveExplorer.NavigationPane.Modules.GetNavigationModule(olModuleCalendar)
Set navGroup = navModCal.NavigationGroups.Item("My Calendars")

If Not (navGroup Is Nothing) Then
navGroup.NavigationFolders.Item("Calendar2").IsSelected = True
navGroup.NavigationFolders.Item("Calendar3").IsSelected = True
navGroup.NavigationFolders.Item("Calendar1").IsSelected = False
navGroup.NavigationFolders.Item("Calendar1").IsSelected = True
End If
End Sub
 
Similar threads
Thread starter Title Forum Replies Date
J [SOLVED] Shared Calendars with Same Appt., How to Show One Entry on Calendar Using Outlook 1
J Not all Outlook "My Calendars" show up in CPA Using Outlook 6
M How do I get Outlook Today to show appts from multiple calendars? Using Outlook 5
J To-do bar needs to show appointments from multiple calendars Outlook Wishlist 3
Victor.Ayala Automated way to check the option "Show this folder as an email Address Book" Outlook VBA and Custom Forms 0
R Sent emails show iCloud mail account not the alias Using Outlook 1
J Names in sent items suddenly show as Bob Smith (bobsmith@sample.com) Using Outlook 3
S Visual indicator of a certain property or to show a macro toggle Outlook VBA and Custom Forms 2
Horsepower Contacts added from iPhone don't show up in Outlook Using Outlook 2
C All Gmails don't show in Outlook 2019 Using Outlook 2
C How to use VBA to show only items x days old or more Outlook VBA and Custom Forms 1
L Option to Show Cancelled Appointments Using Outlook 0
Z How to show concatenated categories in list task view? Using Outlook 2
M Outlook .com group does not show up in Outlook for office 365 home Using Outlook 3
F Appointment Show All Fields Using Outlook 1
G Calendar View in Outlook Office 365 - Doesn't show enough hours, and the 30/60 min choice isn't the solution Using Outlook 4
N How to disable shortcuts for Pilcrow in Outlook (Show or hide paragraph marks) Using Outlook 0
V Outlook Macro to show Flagged messages Outlook VBA and Custom Forms 2
F How to show assigned tasks under certain mailbox? Using Outlook 4
witzker social connector 2010 does not show all emails to or from contact Using Outlook 3
witzker social connector 2010 does not show all emails to or from contact Using Outlook 0
S Outlook.com birthdays show up 1 day late on iPhone contacts list Using Outlook.com accounts in Outlook 27
A Outlook 2016 Will Not Show Any Data In the People Pane Using Outlook 17
Rupert Dragwater Email flag does not show up in Outlook2013 Using Outlook 13
S Show Total Number Of Items Not Displaying Using Outlook 9
Z Tasks from some users show up as emails Using Outlook 4
Caio "From" field doesn't show extra email addresses in Outlook 2016. Using Outlook.com accounts in Outlook 6
O Worksheet doesn't show on jumplist Using Outlook 1
J Outlook 2013 when clicking To in a new email show Company names Using Outlook 0
C Outlook 2016 doesn't show contacts in address book Using Outlook 2
K Daily task list > show tasks on the exact due date and not on the "current date" Using Outlook 1
Rupert Dragwater Some mailboxes show deleted items as not read Using Outlook 5
C Discovery search does not show autoforwarded messages Exchange Server Administration 1
Thorsten show the correct calendar on start Outlook VBA and Custom Forms 5
M Marco doesn't show up when using Alt-F8 Outlook VBA and Custom Forms 2
I Windows 10 - .msg files on disk show Explorer popup error Using Outlook 5
Phillip Show mail items in folder macro Outlook VBA and Custom Forms 2
H How to show recipient email address? Using Outlook 0
H Is it possible to create a view that only show the first task in a list? Using Outlook 1
Diane Poremsky Make the Address Book show only e-mail addresses, not fax numbers Using Outlook 0
G Outlook does not show new appointments in To-Do-Bar Using Outlook 0
L How to show Delivered-To field in Inbox Using Outlook 1
T Desktop alerts show but no emails found Using Outlook 1
oliv- How to select an mailitem in explorer with "show as conversation" Outlook VBA and Custom Forms 8
N To do bar - show more than 30 days of appointments Using Outlook 0
V move emails to windows folder and show sender details Using Outlook 7
M No Show Group on ribbon Using Outlook 8
J Outlook Rules not show Master Category List Using Outlook.com accounts in Outlook 4
A Show ALL of today's appointments in To-Do Bar Using Outlook 1
D Mail accounts don't show up in navigation pane Using Outlook 1

Similar threads

Top