EWS API - Create calendar and share with reviewer permissions

假装没事ソ 提交于 2019-12-05 12:10:55

I figured out how to programmatically send a sharing invitation within an organization through EWS. May not answer all your questions, but it's a good start to understanding how in-depth you gotta get to actually do it. Heres the link

Henning Krause

You have to do two things:

Set the appropiate permissions:

var folder = Folder.Bind(service, WellKnownFolderName.Calendar);
folder.Permissions.Add(new FolderPermission("someone@yourcompany.com", 
    FolderPermissionLevel.Reviewer));
folder.Update();

Then, send an invitation message. Now, this is the hard part. The message format is specifified in [MS-OXSHARE]: Sharing Message Object Protocol Specification. The extended properties are defined in [MS-OXPROPS]: Exchange Server Protocols Master Property List. You need to create a message according to that specification and send it to the recipient.

EDITED:

To set the sharing properties on the element, use extended properties.

First, define the properties. For example, the PidLidSharingProviderGuidProperty is defined as follows:

private static readonly Guid PropertySetSharing = new Guid("{00062040-0000-0000-C000-000000000046}");
private static readonly ExtendedPropertyDefinition PidLidSharingProviderGuidProperty = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A01, MapiPropertyType.CLSID);      
private static readonly ExtendedPropertyDefinition ConversationIdProperty = new ExtendedPropertyDefinition(0x3013, MapiPropertyType.Binary);

You can then set the property on a new item using the SetExtendedProperty method:

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