EWS: Access shared calendars

↘锁芯ラ 提交于 2019-11-29 10:24:00

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.

This is rather complicated, because you need the FolderId of the folder in question. In addition to access to the calendar folder you'll need read access to the root folder of the mailbox. This allows you to execute a FindFolder operation to retrieve that id.

KILL_MementoMori

I know it's a couple of years after the original post, but just to help people with similar problems, look at this.

It uses the EWS API's WellKnownFolderName.PublicFoldersRoot to access the public folder and browses to the requested subfolder using FolderId's.

Twelve24

If you need to do this in Java, here's and answer that could help. Office365 API - Admin accessing another users/room's calendar events. It's got a working sample of code. Until MS gets the Azure V2.0 REST API working, this is the way to do it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!