Exchange server 如何使用Exchange Web Services托管API设置联系人标题

Exchange server 如何使用Exchange Web Services托管API设置联系人标题,exchange-server,exchangewebservices,ews-managed-api,Exchange Server,Exchangewebservices,Ews Managed Api,我正在尝试使用EWS API创建一个新联系人。我可以设置除contact title属性之外所需的所有值。我试过密码: oContact = new Contact(oService); oContact.GivenName = "John"; oContact.Surname = "Doe"; oContact.Displayname = oContact.Surname; // set the title property as extended property // reference

我正在尝试使用EWS API创建一个新联系人。我可以设置除contact title属性之外所需的所有值。我试过密码:

oContact = new Contact(oService);
oContact.GivenName = "John";
oContact.Surname = "Doe";
oContact.Displayname = oContact.Surname;

// set the title property as extended property
// reference: http://msdn.microsoft.com/en-us/library/gg274394.aspx
ExtendedPropertyDefinition oTitleProp = new ExtendedPropertyDefinition(
  new Guid("{00062004-0000-0000-C000-000000000046}"),
  0x3A45,
  MapiPropertyType.String);
oContact.SetExtendedProperty(oTitleProp, "Mr.");

oContact.Save();
我没有收到错误,但当我在outlook 2010中检查标题字段时,它是空的。我正在使用Exchange 2010

知道我做错了什么吗

问候


沃克玛

简短回答

创建扩展属性定义时,不要使用指定
propertySetId
的构造函数,而不要使用上面的代码。相反,请按如下方式构建:

ExtendedPropertyDefinition oTitleProp = new ExtendedPropertyDefinition(
    0x3A45,
    MapiPropertyType.String);
更长的答案

你从微软得到的参考资料很有趣。通过阅读Microsoft Exchange Server 2007 Web Services内部有关扩展属性的一章,我一直认为对于不在自定义范围内的扩展属性(低于0x8000的),在引用它们时应该省略propertySetId,因此有趣的是,在该页上,Microsoft似乎暗示您将使用它

值得一提的是,MicrosoftExchangeServer2007Web服务中有一个免费提供的附录(附录C),其中还记录了扩展属性,在何时使用propertySetId和何时不使用propertySetId方面可能比Microsoft页面更清晰

还有一个更精确的属性列表及其相应的属性集,位于