I am building an application in Embarcadero Delphi that amongst other things wants to read appointments from outlook calendars shared with the current user.
My problem is a lack of understanding where to find these in the folder-structure.
On my desktop I use Outlook 2010 (14.0.7188.5002 32-Bit) connected to an exchange server. I am able to add calendars shared by colleagues to my calendar-view in Outlook:
I can see selected information about their appointments, mainly whether they are free or booked. Exactly what my external tool wants to know.
Now I would like to access those calendars via the Outlook object model.
(I apologize for posting Delphi-Code, but it is mostly going straight to the imported TLB which in other places works as advertised)
I tried using GetSharedDefaultFolder()
like this:
Recipient := FOutlook.NameSpace.CreateRecipient('bernie@someplace.com');
Recipient.Resolve;
SharedFolder := FOutlook.Namespace.GetSharedDefaultFolder(Recipient, olFolderCalendar);
But this unfortunately fails on the call to GetSharedDefaultFolder()
. The Recipient is correct, it resolves fine. The error thrown (as Delphi exception) is:
EOleException - Der versuchte Vorgang konnte nicht ausgeführt werden. Ein Objekt wurde nicht gefunden
This translates back into english as: "The attempted action could not be completed. An object was not found".
I would appreciate any input on how to access the same information Outlook is showing me in the UI when I select a shared calendar, only via the object model.
Thanks in advance for your time, Marian