How to set the contact title using Exchange Web Services Managed API

前端 未结 1 719
旧巷少年郎
旧巷少年郎 2021-01-19 19:07

I\'m trying to create a new contact using the EWS API. I can set all the values i needed except the contact title property. I tried the code:

oContact = new          


        
相关标签:
1条回答
  • 2021-01-19 19:46

    Short Answer

    When creating the extended property definition, instead of the code you have above, don't use the constructor where you specify the propertySetId. Instead, construct it like this:

    ExtendedPropertyDefinition oTitleProp = new ExtendedPropertyDefinition(
        0x3A45,
        MapiPropertyType.String);
    

    Longer Answer

    That reference you have from Microsoft is interesting. From reading the chapter about extended prorperties in Inside Microsoft Exchange Server 2007 Web Services, I always thought that for extended properties not in the custom range (those below 0x8000), you'd leave out the propertySetId when referencing them, so it's interesting that on that page, Microsoft seems to imply you'd use it.

    For what it's worth, there's a freely available appendix (Appendix C) to Inside Microsoft Exchange Server 2007 Web Services that also documents extended properties at http://www.microsoft.com/mspress/companion/9780735623927/ that might be clearer than that Microsoft page on when to use propertySetId and when not to.

    There's also a more-accurate list of properties and their corresponding property sets at http://msdn.microsoft.com/en-us/library/cc433490(EXCHG.80).aspx

    0 讨论(0)
提交回复
热议问题