I am trying to write a macro which would create an appointment in O365 group calendar. I am able to create the appointment if the current folder is the group calender. However, I want the macro to always create the appointment for the group calendar, irrespective of the current folder. I have looked at other posts on accessing shared calendar and other subfolders under default calendar, but I am not able to find anything that works for a group calender.
I have tried these things:
Set calFolder = GetFolderPath("firstname.lastname@example.org\Calendars\groupname")
Set NameSpace = Application.GetNamespace("MAPI")
' option 2
Set calFolder = NameSpace.GetDefaultFolder(9).Folders("groupname")
Set Items = calFolder.Items
' option 3
Set Items = Application.Session.GetDefaultFolder(olFolderCalendar).Parent.Folders("groupname").Items
In the folder structure it appear like this:
Appreciate any pointers. Thanks in advance!
I found this structure for the group I am looking for in the debugger:
Namespace | AddressLists | | Item 7 : Name: All groups | AddressEntries | Item 18: Name: abc
Is there a way I can use this information to get the folder?