Outlook Web 插件如何在 JS 中通过 EWS 获取客户属性

Outlook web add-in How to get customer properties via EWS in JS

如果我通过 Outlook JS 保存客户属性,如何通过 JS 中的 EWS 获取它们。 API

  1. 我使用以下 JS 代码保存了自定义属性:

       Office.context.mailbox.item.loadCustomPropertiesAsync(callback);
    
          function callback(asyncResult) {
          var customProps = asyncResult.value;
          customProps.set("isSync", "test");
    
         // Save custom properties via JS API
         customProps.saveAsync(saveCallback);
        }
    
  2. 那我想通过EWS获得这个自定义繁荣

案例 1:

   '<t:ExtendedFieldURI PropertySetId="cecp-my manifest" PropertyName="isSync" PropertyType="String"/>' 

案例二:

   '<t:ExtendedFieldURI DistinguishedPropertySetId="PublicStrings" PropertyName="isSync" PropertyType="String"/>' 

这两种方法都行不通。我应该如何描述

同时,如果我使用 .Net,一切正常:

 ExtendedPropertyDefinition extendedPropertyDefinition = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.PublicStrings, "cecp-my manifest", MapiPropertyType.String);
 var props = new PropertySet(BasePropertySet.FirstClassProperties, ItemSchema.MimeContent, extendedPropertyDefinition);'

你的属性定义应该是

'<t:ExtendedFieldURI DistinguishedPropertySetId="PublicStrings" PropertyName="cecp-my manifest" PropertyType="String"/>' 

这将 return 所有自定义属性(作为 Json 字符串)如果设置了 isSync 应该在其中。