Accessing a Resource Calendar with no mailbox via EWS and C#

落爺英雄遲暮 提交于 2019-12-05 14:51:31

Bind to that Calendar with a mail-Adress

Create first of all a FolderId:

FolderId parkplatzCalendarId = new FolderId(WellKnownFolderName.Calendar,"de.calendar.name@company.com");

Then bind to this one:

CalendarFolder calendar = CalendarFolder.Bind(_service, parkplatzCalendarId);

Now you can use this calendar!

CalendarView cView = new CalendarView(start, end, int.MaxValue);

cView.PropertySet = new PropertySet(AppointmentSchema.Subject, AppointmentSchema.Start, AppointmentSchema.End, AppointmentSchema.Duration, AppointmentSchema.LastModifiedName, AppointmentSchema.Organizer, AppointmentSchema.Categories);

FindItemsResults<Appointment> appointments = calendar.FindAppointments(cView);

With something like that ;D

If the calendar is actually not in any particular mailbox, then it should be in a public folder, and you should look in a subfolder WellKnownFolderName.PublicFoldersRoot.

Otherwise, please tell where exactly does it appear in Outlook folders hierarchy.

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