Outlook Calendar Display

Status
Not open for further replies.

DigitalDawn

Senior Member
Outlook version
Outlook 2019 32-bit
Email Account
Office 365 Exchange
Hi,

I'm using Outlook 2007 with iCloud via the Code Two iCloud Sync program, and it works very well, but I'm having an odd problem.

I like to only view my Outlook Calendar, along with the Outlook ToDo Bar on the right. I keep the navigation pane closed. Whenever I start up Outlook, and switch to my contacts view, and then go back to the Calendar view, both the iCloud and Outlook calendars show up together. It's really annoying, as I then have to open the Navigation pane and un-check the iCloud calendar. This occurs randomly as well, but I can definitely make it happen with the above steps.

Is there a way to stop this from happening? Can I permanently disable the iCloud calendar (un-check it) without having sync issues?

Thanks,

Dawn
 

DigitalDawn

Senior Member
Outlook version
Outlook 2019 32-bit
Email Account
Office 365 Exchange
Use the method described at Always open a specific outlook folder to control it.

I don't believe checked/unchecked affects the sync, but iCloud always sets its calendars to open.

Diane,

Not sure if I got this right, because it didn't work.

I made sure that both calendars were showing. Then I opended the VB screen with Alt F11.

I pasted the following into the ThisOutlookSession editor.

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 CalendarModule
Dim objGroup As NavigationGroup
Dim objNavFolder As NavigationFolder

If CurrentModule.NavigationModuleType = olModuleCalendar Then
Set objModule = objPane.Modules.GetNavigationModule(olModuleCalendar)

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

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

I then clicked in the startup sub and hit run.

After switching back to the Calendar, I got the following errors:

Runtime Error 91

Object Variable or with block variable not set.

After hitting debug, the following line is highlighted:

Set objNavFolder = objGroup.NavigationFolders.Item(1)

What did I do wrong? The Calendar I wish to use is the first one.

Thanks, Diane.

Dawn

P.S. The spacing is correct in the VBA file. "Calend ar" seems to be a formatting issue in the forum editor only.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Yeah, i don't know what is up with the editor - the code is not that long, but a line always gets an extra space stuck somewhere.

The group was missing an S here -
Set objGroup = objModule.NavigationGroups("My Calendars")
 

DigitalDawn

Senior Member
Outlook version
Outlook 2019 32-bit
Email Account
Office 365 Exchange
Diane,

Getting closer :)

The script does work, as it always sets my calendar to on. But it still leaves the iCloud calendar on (checked), so I still have both showing. Is there a string that can be added to uncheck the iCloud calender?

As always, thanks for your help.

Dawn
 

Forum Admin

Senior Member
obviously, objNavFolder.IsSelected = True needs to be false, but I'm not sure how to go through all and disable.

maybe something like

for each objGroup.NavigationFolders.Item

objNavFolder.IsSelected = false

next
 

Forum Admin

Senior Member
This worked here - it would probably be better to set everything false then set #1 true... but I was lazy and stuck it in after.
Set objNavFolder = objGroup.NavigationFolders.Item(1)
objNavFolder.IsSelected = True
' New code
For i = objGroup.NavigationFolders.Count To 2 Step -1
Set objNavFolder = objGroup.NavigationFolders.Item(i)
objNavFolder.IsSelected = False
Next
End If
 

DigitalDawn

Senior Member
Outlook version
Outlook 2019 32-bit
Email Account
Office 365 Exchange
Diane,

I tried the new code and it didn't work.

See below:

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 CalendarModule
Dim objGroup As NavigationGroup
Dim objNavFolder As NavigationFolder

If CurrentModule.NavigationModuleType = olModuleCalendar Then
Set objModule = objPane.Modules.GetNavigationModule(olModuleCalendar)

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

' Replace 4 with the index number of the folder you want to use
For i = objGroup.NavigationFolders.Count To 2 Step -1

Set objNavFolder = objGroup.NavigationFolders.Item(i)

objNavFolder.IsSelected = False

Next
End If
Set objNavFolder = Nothing
Set objGroup = Nothing
Set objModule = Nothing
End Sub

Dawn
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
What happens? (It works here) - oh, did i mislead you. The entire snippet i posted replaces the code between the first and last lines of the snippter - like this:

Private Sub objPane_ModuleSwitch(ByVal CurrentModule As NavigationModule)
Dim objModule As CalendarModule
Dim objGroup As NavigationGroup
Dim objNavFolder As NavigationFolder
If CurrentModule.NavigationModuleType = olModuleCalendar Then
Set objModule = objPane.Modules.GetNavigationModule(olModuleCalend ar)
' Use the Group name the folder is in
Set objGroup = objModule.NavigationGroups("My Calendars")

Set objNavFolder = objGroup.NavigationFolders.Item(1)
objNavFolder.IsSelected = True
For i = objGroup.NavigationFolders.Count To 2 Step -1
Set objNavFolder = objGroup.NavigationFolders.Item(i)
objNavFolder.IsSelected = False
Next
End If
Set objNavFolder = Nothing
Set objGroup = Nothing
Set objModule = Nothing
End Sub
 

DigitalDawn

Senior Member
Outlook version
Outlook 2019 32-bit
Email Account
Office 365 Exchange
Diane,

The script does work to check the main calendar, but again, it did not uncheck the iCloud calendar.

See the image below:

icloud calendars.jpg
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
i'll test it again - iCloud mostly honors my settings on 2010 and 2013. I didn't test the macro on 2007 though.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
M In Outlook Calendar remove the buttons: 'Today' and '<' (Back a day) and '>' (Forward a day) that are below the Ribbon and above the calendar display. Using Outlook 0
T Outlook 2016 Calendar multiday event display Using Outlook 4
M how to change outlook calendar time display Using Outlook 5
J VBA for outlook to compare and sync between calendar Outlook VBA and Custom Forms 1
A force outlook to default to MY calendar Using Outlook 3
P Outlook calendar and contacts sync problem-outlook disconnects Using Outlook.com accounts in Outlook 2
HarvMan Toggle between calendar and email in Outlook 365 Using Outlook 12
M Outlook calendar is missing Using Outlook 2
A Any way to make Outlook Calendar invitations look right to Gmail/Google Calendar users? Using Outlook 3
I Outlook is stuck at "Updating Calendar" Using Outlook 1
AmonRa Outlook 365 calendar - too much white space Using Outlook 0
P Outlook 2013 Calendar Archiving Using Outlook 0
E Work uses live accounts for emails for all employees. Can we use the outlook calendar to give the employees an universal work schedule calendar? Using Outlook 1
B Outlook Calendar not coming down from cloud Using Outlook 2
J Time Zone Issues - Outlook Calendar and Webcal Feed Using Outlook 8
HarvMan Outlook 365 Calendar Using Outlook 13
A calendar invites sent from Microsoft Outlook to Mac Outlook is not working Using Outlook 2
O Export Outlook calendar appointments by filters and date range Outlook VBA and Custom Forms 1
D Add date next to day name in Outlook Today calendar view Using Outlook 1
C Put Day of Year into Outlook Calendar Outlook VBA and Custom Forms 2
J can't sync outlook calendar contacts with iphone ipad Using Outlook 4
C Outlook Calendar Using Outlook 1
sahameed82 SharePoint calendar directly open in Outlook Using Outlook 0
D Outlook 2016 Migrate 'On My Computer' (local storage) Calendar from Mac Outlook to Exchange Account Using Outlook 5
J Outlook 2010 Changing events in Outlook calendar via opening file, importing CSV Using Outlook 0
M Creating an RSS Feed **FROM** Outlook 2013 Calendar. Using Outlook 5
K Accentuating today in Outlook calendar month view Using Outlook 2
S outlook 2007 calendar search Using Outlook 6
J Copy to calendar function no longer working in outlook 365 Using Outlook 5
W Outlook Calendar does not save view any longer! Using Outlook 3
M move to iCloud not working in outlook calendar Using Outlook 12
F My hotmail calendar is not syncing with my outlook but my email is Using Outlook 3
T Outlook 2010 Advice on syncing OL2010 Calendar and Outlook app Using Outlook 0
L Time format in Outlook calendar and emails Using Outlook 0
S Outlook 2007 Calendar instant search problem. Windows 7 Using Outlook 4
S Outlook 2007 Calendar instant search problem. Windows 7 Using Outlook 0
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
W Migrating Outlook 365 Contacts & Calendar Using Outlook 2
W Outlook 2019, Outlook Proplus v1808/1809 Unexpected Calendar Cache Using Outlook 4
Mark Foley Unable to subscribe to published calendar in Outlook 2010 Using Outlook 4
G Outlook VBA and Google Calendar ("Events") Outlook VBA and Custom Forms 1
F outlook calendar analysis Outlook VBA and Custom Forms 0
P Making iCloud the default calendar for Outlook 2016 Using Outlook 3
G Unable to dismiss reminders from share point list calendar shared in Outlook Using Outlook 2
J Outlook 2016 Calendar time discrepancies Using Outlook 4
S Missing Outlook calendar and contacts Using Outlook 0
S View Appointment in Text Wrap in Outlook 2007 Month Calendar View Using Outlook 0
P Outlook search is not working at all for Calendar & Tasks Using Outlook 7
J Outlook 2016 shows Meeting Organizer in Calendar View Using Outlook 5
A Outlook Calendar Using Outlook 7

Similar threads

Top