I'm trying to open a non-default shared calendar in Outlook using VBA but I only know how to open the default one. I have spent a considerable amount of time researching this online but no luck. Any help would be greatly appreciated.
The user name of the shared calendar is "John Burns" and the non-default calendar name is "Van".
My code to retrieve the default shared calendar is :
Dim myOlApp As Outlook.Application
Dim myNms As Outlook.NameSpace
Dim myFolder As Outlook.MAPIFolder
Dim myRecipient As Outlook.Recipient
Dim myExplorer As Outlook.Explorer
Dim SharedFolder As Outlook.MAPIFolder
Set myOlApp = CreateObject("Outlook.Application")
Set myNms = myOlApp.GetNamespace("MAPI")
Set myFolder = myNms.GetDefaultFolder(olFolderCalendar)
Set myExplorer = myOlApp.ActiveExplorer
Set myExplorer.CurrentFolder = myFolder
Set myRecipient = myNms.CreateRecipient("John Burns")
Set SharedFolder = myNms.GetSharedDefaultFolder(myRecipient, olFolderCalendar)