How to stop iCloud calendars opening by default

Status
Not open for further replies.

chunkywizard

Member
Outlook version
Email Account
IMAP
Hi there,

I hope you can help me. I am a newbie to scripts in Outlook but have been doing a bit of reading. Bascially I have installed CodeTwo Sync for iCloud and now I have 2 active iCloud calendars everytime I boot. I wish only for my main calendar (My Calendars: Calendar) to be active on boot. Reading the forum it looks as though I can change this behaviour by using a script. I thought I should copy this: https://forums.slipstick.com/threads/90118-outlook-calendar-display/ but I can't get it to work. Can you help?

The steps I take are:

Alt F11

double click 'ThisOutlookSession'

pasted text below in

save

press play

(a box titled Macro comes up)

named macro and clicked create

press play

(a box titled macro comes up)

click run

nothing happens

I am running Outlook 2007 SP3 and have Macro security set to Warnings for All Macros

Just to confirm, the text I am pasting is:

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

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

' 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
Set objNavFolder = objGroup.NavigationFolders.Item(1)
objNavFolder.IsSelected = True
End If
Set objNavFolder = Nothing
Set objGroup = Nothing
Set objModule = Nothing
End Sub

Any ideas what I am doing wrong (or what is wrong with the script)? Any help, gratefully appreciated,

Paul
 
If you want to remove the iCloud calendar you need deselect the iCloud calendars too - something like this -
Set objGroup = objModule.NavigationGroups("iCloud")
' Replace 4 with the index number of the folder you want to use
Set objNavFolder = objGroup.NavigationFolders.Item(1) ' first icloud calendar
objNavFolder.IsSelected = False

I'll need to test it with outlook 2007 to see if it is outlook or something you're overlooking.

one thing on these steps:

Alt F11
double click 'ThisOutlookSession'
pasted text below in
save
press play <== on this you need to click in Application_Startup and press Run (play icon)
 
Hi Diane,

thanks for coming back to me. So I tried your suggestion but I can't get it to work. I fear it's my incompetence rather than your advice. So my full script now is copied below. I am not sure if I replaced the right bit, or whether it was an addition rather than a substitution. In fact do I need all of this script if all I want to do is deselect the 2 iCloud calendars? I am afraid I just blindly copied the other example and don't really understand if all of it is needed. Anyway, it seems to do nothing, I do believe I clicked in Application Startup though (I changed the left of 2 drop-downs to Application and the right one defaulted to Start Up, is this right?)

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

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

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

' Replace 4 with the index number of the folder you want to use
Set objNavFolder = objGroup.NavigationFolders.Item(1)
objNavFolder.IsSelected = False
End If
Set objNavFolder = Nothing
Set objGroup = Nothing
Set objModule = Nothing
End Sub
 
Oh, one error is it's looking at contacts, not calendar module. I didn't even notice that oops before. The automatic macro at http://www.slipstick.com/developer/code-samples/select-multiple-calendars-outlook/ works perfectly, and with multiple icloud calendars. It assumes you have 3 calendars selected - the one you want and the iCloud calendars (2 in my case). If you have more than 2, then and the numbers to the case line. When I remove the issidebyside line, the calendar opened in list view after the first time - it shouldn't matter true or false, since only one calendar is open. But if you want two open that can affect side by side or overlay.

[removed code see next message for new code]
 
Hm. it worked a few times then stopped working. I removed the side by side line and its working again. The if statement checks to see if they are checked, so I'm not dropping to list view.

Code:
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 = .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 open
           Case 1, 2
            If objNavFolder.IsSelected = True Then
               objNavFolder.IsSelected = False
               'objNavFolder.IsSideBySide = False
            Else
            End If
            
       End Select
   Next
   End If

  Set objPane = Nothing
   Set objModule = Nothing
   Set objGroup = Nothing
   Set objNavFolder = Nothing
   Set objCalendar = Nothing
   Set objFolder = Nothing 
 
End Sub
 
Hi Diane,

thanks for your continued help, it's most appreciated. To update you, I think this is working now but there is a slight related glitch. When I start Outlook I get a Microsoft Office Outlook Security Notice for ThisOutlookSession. If I enable Macros everything seems to work. However when Outlook is restarted I get the pops up again.

My macro security is set to Warning for all macros.

Any ideas?

Paul
 
Hi Diane,

thanks for your continued help, it's most appreciated. To update you, I think this is working now but there is a slight related glitch. When I start Outlook I get a Microsoft Office Outlook Security Notice for ThisOutlookSession. If I enable Macros everything seems to work. However when Outlook is restarted I get the pops up again.

My macro security is set to Warning for all macros.

Any ideas?

Paul

Hi Diane,

I think you might have missed my question. I still get this issue and would like to get it sorted. Every time I start Outlook I get an Outlook Security Ntice stating "Microsoft Office has identified a potential security concern. ThisOutlookSession. Macos have been disabled etc. I need to click Enable Macros every time. Can you suggest what I need to do to make this disappear?

Regards

Paul
 
Hi Diane,

thanks for the reply. You'll be glad to hear I am now sorted, your advice worked a treat. Thanks very much for your help

CW
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
Victor_50 Problem - Google Workspace will stop "unsafe" access to Outlook end 2024 Using Outlook 3
L How Stop Outlook Nag Messages Using Outlook 1
G Stop Outlook 365 adding meetings to calendar Using Outlook 1
L Emails being archived when I press the A key accidentally - how do I stop this? Using Outlook 0
P How can I stop Outlook 365 duplicating the posts? Using Outlook 1
J how to stop junk emails from *.onmicrosoft.com ? Using Outlook 2
A How to stop user form from disapearing once mail window is closed? Outlook VBA and Custom Forms 0
D Outlook 2016 Outlook Error Msg "The operation cannot be performed ..." How to Stop it Using Outlook 4
T "Words In Recipient's Address" Rule Causes Outlook To Stop Processing Rules Using Outlook 3
Y Outlook 2013 Stop Outlook from automatically assigning categories to Tasks Using Outlook 0
D Any updates or fixes that would make this code stop working just moving emails to another folder Outlook VBA and Custom Forms 1
F Outlook 2016 call to Stop Timer Event Outlook VBA and Custom Forms 4
S stop calendar date reverting to today Using Outlook 7
B Contacts just stop syncing, yesterday... Using Outlook 4
O Stop more than one person responding to an email? Using Outlook 1
A Stop Rule (not turn off) that Delays Outgoing Items Outlook VBA and Custom Forms 1
A Can't stop Outlook.com from setting reminders on appointments? Using Outlook.com accounts in Outlook 3
D Stop meeting acceptance notifications Using Outlook 1
J it goes like outlook has stopped working, a problem caused the program to stop working correctly, wi Using Outlook 2
makinmyway Research Pane in Emails Turns on and Cut Paste Keys then Stop Working Using Outlook 5
J How to Stop OutLook from being Installed Using Outlook 1
A Exchange 2003 how to stop accepting EHLO and AUTH commands Exchange Server Administration 2
M Outlook 2010 IMAP rules occasionaly stop working Using Outlook 4
icacream outlook 2007 - how do I stop spacing when I hit return ? Using Outlook 4
T Outlook 2007 SSL selfsigned certificate how to stop security popup everytime? Using Outlook 10
Y How do you stop double booking? Using Outlook 1
Commodore Why some RSS feeds stop getting updates? Using Outlook 12
N Rules stop running automatically Using Outlook 10
S Stop mail checking Using Outlook 5
M Can you stop "Microsft Office Outlook is synchronizing folders"? Using Outlook 2
C stop messages to personal folders Using Outlook 2
M Why rules stop running automatically? Using Outlook 1
J Stop Outlook 2010 from showing face pictures in From/To/Cc/Subject box Using Outlook 2
S Shared Calendar Need To Stop Receiving Other Peoples Reminders Using Outlook 3
R Stop Double Booking Rooms Using Outlook 3
C stop facebook? Using Outlook 16
A How do I get Outlook to stop adding a "+1" in front of a telephone number that has an extension. Using Outlook 13
L Outlook inbox is "always in front". How to stop that? BCM (Business Contact Manager) 1
M Stop Search folders from disabling every 1-2 days? Outlook VBA and Custom Forms 3
N VBA Procedure (or Macro) to Stop Outlook from Closing? Outlook VBA and Custom Forms 2
M Stop ribbon item tool tip text from wrapping? Outlook VBA and Custom Forms 2
D Stop automatic opening BCM (Business Contact Manager) 1
C How to stop replies in thier tracks Outlook VBA and Custom Forms 1
A stop outlook reminders generated through BCM BCM (Business Contact Manager) 3
V iCloud For Windows v15.x - Missing Email Features ? Using Outlook 4
B Outlook 2019 iCloud says “UN or PW is incorrect” but they are correct. Using Outlook 0
G Outlook 365 My iCloud Outlook doesn’t work after reinstalling Microsoft365 on Windows 10 PC – now I get error message on contacts and calendar Using Outlook 1
C reminders not synced by CodeTwo Sync for iCloud Using Outlook 2
P How to clear out all contacts in iCloud, so I can use iCloud-based sync program Using Outlook 1
D Outlook app 2021 & iCloud PST issues Using Outlook 2

Similar threads

Back
Top