How to stop iCloud calendars opening by default

Status
Not open for further replies.

chunkywizard

Member
Outlook version
Outlook 2007
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
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
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)
 

chunkywizard

Member
Outlook version
Outlook 2007
Email Account
IMAP
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
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
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]
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
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
 

chunkywizard

Member
Outlook version
Outlook 2007
Email Account
IMAP
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
 

chunkywizard

Member
Outlook version
Outlook 2007
Email Account
IMAP
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
 

chunkywizard

Member
Outlook version
Outlook 2007
Email Account
IMAP
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.
Thread starter Similar threads Forum Replies Date
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
W To stop outlook 2010 to open my browser at file:///C:/Users/username/AppData/Local/Microsoft/Windows Using Outlook 1
G How can I stop duplicate e-mails being sent to my sent folder in Outlook 2010? Using Outlook 2
N Stop accepting connections for sending e-mail from users not having a mailbox Exchange Server Administration 6
D Outlook 2010 - Tasks - Stop using "To-Do List" Using Outlook 2
M when I save my messages it saves images as attachments . how can I stop it ? Using Outlook 16
A How do I stop automatic e-mail forwarding? Using Outlook 2
P After window 7 idle for few minutes then outlook 2010 stop send and receive Using Outlook 2
G How to stop Live mail from getting my Outlook mail Using Outlook 2
D Use of outlook blocked by stop symbol Using Outlook 2
A stop Outlook 2010 from downloading email with IMAP settings Using Outlook 1
F how do i stop my emails from leaving the outbox the moment I hit "send". Using Outlook 2
W Outlook 2007 stop sending mail, can receive but not send email Using Outlook 2
B Using Oulook and have 2 accts. Admin acct gets other acct email as well. How do I stop? Using Outlook 1
J Stop details info reply from Exchange 2010 Server of undeliverable message to external recipent Exchange Server Administration 2
F Stop Address Auto Save Using Outlook 1
M Can't stop the new mail beep - already unchecked play sounds box. Using Outlook 1
A How to stop .pst getting email repeatedly ? ( outlook 2010 ) Using Outlook 3
B Stop read receipts from being requested when i send emails Using Outlook 1
C how do i stop calender reminders? Using Outlook 1
R Emails Stop Exchange Server Administration 21
J Outlook 2007 - How Do I stop Most Messages Getting Marked As Spam? Using Outlook 2
J Appointment times automatically moved 2 hours when I changed time zones...how do I stop this? Using Outlook 1
Y How can I stop incoming mail but keep the old mail? Using Outlook 1
Similar threads


















































Top