This is specific to Office 2013.
In previous versions of Office (2010), I had a script which would download an .ics attachment and then save it to my calendar. After loading the .ics I then iterate through the .ics file and copy all AppointmentItem
's to my calendar.
Dim oSharedFolder As Outlook.folder
Set oSharedFolder = _
Application.GetNamespace("MAPI").OpenSharedFolder( _
"C:\Temp\1421940003_event.ics")
However, in 2013 VBA the OpenSharedFolder
method does not allow me to do this anymore, saying "The operation failed." In exploring the MSDN documentation I see:
OpenSharedFolder - This method does not support iCalendar appointment (.ics) files. To open iCalendar appointment files, you can use the OpenSharedItem method of the NameSpace object
Ok, great! They changed the name to OpenSharedItem instead (ignore their example using an .ics file.. which has the same error). However when I go there, I see:
So both these link to each other -- incorrectly, I might add, since both fail, even though both examples say they work for ics files.
My question is:
- How can I open an .ics file with Outlook 2013 vba?