0
我正在使用Exchange Web服务访问公用文件夹中的联系人记录。我需要为该文件夹中的视图创建一个自定义列“客户端联系人管理”。自定义列是在用户界面中创建的。从交换公用文件夹访问自定义视图列
我已经在我自己通过代码创建的属性上使用过ExtendedPropertyDefinition
类。这是我应该用在这种情况下,如果是这样,那么我如何得到自定义列的GUID?
我正在使用Exchange Web服务访问公用文件夹中的联系人记录。我需要为该文件夹中的视图创建一个自定义列“客户端联系人管理”。自定义列是在用户界面中创建的。从交换公用文件夹访问自定义视图列
我已经在我自己通过代码创建的属性上使用过ExtendedPropertyDefinition
类。这是我应该用在这种情况下,如果是这样,那么我如何得到自定义列的GUID?
我终于找到了答案这个thread从大卫·斯特林上的Microsoft Exchange Server论坛。他的例子(下面复制)显示了如何直接使用EWS和使用托管API。
// via autogenerated proxy classes
PathToExtendedFieldType hairColorPath = new PathToExtendedFieldType();
hairColorPath.DistinguishedPropertySetId = DistinguishedPropertySetType.PublicStrings;
hairColorPath.DistinguishedPropertySetIdSpecified = true;
hairColorPath.PropertyName = "HairColor";
hairColorPath.PropertyType = MapiPropertyTypeType.String;
// via the Client API
ExtendedPropertyDefinition hairColor = new ExtendedPropertyDefinition(
DefaultExtendedPropertySet.PublicStrings,
"HairColor",
MapiPropertyType.String);
这是我为自己的问题使用托管API。关键是使用DefaultExtendedPropertySet.PublicStrings
这是Outlook存储自定义视图列的位置。
ExtendedPropertyDefinition _clientContactManagementPropertyDefinition =
new ExtendedPropertyDefinition(
DefaultExtendedPropertySet.PublicStrings,
"Client Contact Management",
MapiPropertyType.Boolean
);