How to create a Appointment in a Shared Calendar (Sharepoint) with VBA (Macro)?
- by Diogo K.
I am actually trying to make an appointment from an excel spreadsheet. I have all the information of the appointment, like subject, body, start and end dates, I actually can create an appointment but only with my personal calendar in outlook.
How do I copy/move/create an appointment in a shared calendar in a sharepoint server?
I've tried:
Dim apOL As Object
Dim objFolder As Folder
Dim cro As String
Set apOL = CreateObject("Outlook.Application")
Set oItem = apOL.CreateItem(olApItem)
Set MAPISession = apOL.Session
...
cro = "stssync://sts/?ver=1.0&type=calendar&cmd=add-folder&base-url=(MY SP SERVER)&list-url=%2FLists%2FCronograma%20%20%2Fcalendar%2Easpx&guid=%7B02717CEF%2D404F%2D482F%2DA131%2D5C3C245CD268%7D&site-name=Testes&list-name=Cronograma%20-"
...
Set objFolder = MAPISession.OpenSharedFolder(cro, Null,Null,Null)
It gives me the error "Type Mismatch"
I'd try to get the objFolder as the Sharepoint Folder then later create an local appointment and then try an Item.Move objFolder
Is it the correct way?