Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
382 views
in Technique[技术] by (71.8m points)

exchange server - EWS: Access shared calendars

I am trying to use Exchange Web Services to access calendar data, but I can't seem to figure out how to access calendars which have been shared by other users when it is not their default calendar. Assuming another user in my company created a shared calendar and shared it with me, I can't even find the calendar folder, let alone get the items within it.

The answers can be in terms of the EWS Managed API (version 1.0 or 1.1), the service objects directly, or even just the XML body of the SOAP message that needs to be sent to the server. I just need some kind of starting point. Any help would be greatly appreciated.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Here's how I managed to do it:

Dim _cal As New Microsoft.Exchange.WebServices.Data.FolderId(Microsoft.Exchange.WebServices.Data.WellKnownFolderName.Calendar, New Microsoft.Exchange.WebServices.Data.Mailbox(_otherAddress))
Dim _calendarView As New Microsoft.Exchange.WebServices.Data.CalendarView(_startTime.Date, _endTime.Date.AddDays(1))

For Each appointmentItem As Microsoft.Exchange.WebServices.Data.Appointment In _
    service.FindAppointments( _
    _cal, _
    _calendarView)
Next

Note: this only works for the default calendar as that is all I needed for my requirements

Edit: For non-default calendars, have you looked into the ExchangeService.FindFolders method, I have not tried but this might not require root inbox access.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...