none
EWS - Folder hierarchy and items sync RRS feed

  • Question

  • Hi,

    Note: I asked the questions below on older Exchange forum and haven't gotten any response. I am hoping my questions will get more visibility here.

    I have a couple of questions about folder sync with EWS. The environment is all Exchange versions that supports EWS (Exchange 2007 SP1 and/or other Exchange servers all the way to 2013).

    1. After calling EWS-SyncFolderHierarchy with FirstClassProperties, we will get collection of FolderChange objects.

    I am looking for a way to check whether a folder is a well known folder.
    WellKnownFolderName prop is part of the FirstClassProperties. Not sure why WellKnownFolderName value returned in FolderChange object is null. I have looked at several properties inside the Folder and FolderId objects, however, I haven't found a property where it has WellKnownFolderName value being populated.

    Do I need to extend the property set? If so, please let me know the extended property.

    2. When calling EWS-SyncFolderItems for the first time (full sync), I would like to apply/pass a datetime restriction so it will only return me messages from certain creation datetime (PR_CREATION_TIME) to now.
       I don't see a way to do this via SyncFolderItems' arguments. I can inspect the changes and filter them on my own, however, of course, it is preferred to let Exchange does the filtering.
      

    Thanks.



    • Edited by Blackfield Friday, April 5, 2013 3:54 PM
    Friday, April 5, 2013 3:45 PM

All replies

  • on # 1, I still can't get the WellKnownFolderName (not sure why).

    To get around it, I can find a folder id of a WellKnownFolderName so I can compare the folder id from the SyncFolderHierarchy's return result.

    To find WellKnownFolderName's folder id, I can call :

    var folder = Folder.Bind(exchangeService, WellKnownFolderName.Inbox);

    var inboxFolderId = folder.Id.ToString();

    But, I need to call the above for many well known folders just so I can recognize whether a folder is a WellKnownFolderName and what kind.

    Anybody know better way than the above?

    Tuesday, April 9, 2013 7:59 PM
  • WellKnownFolderName probably did not include in FirstClassProperties by default.

    You can try by adding it to your propertySet

    FolderSchema.WellKnownFolderName and/or FolderSchema.DisplayName

    Tuesday, April 9, 2013 8:23 PM
  • WellKnownFolderName probably did not include in FirstClassProperties by default.

    You can try by adding it to your propertySet

    FolderSchema.WellKnownFolderName and/or FolderSchema.DisplayName

    FolderSchema.WellKnownFolderName is only valid for Exchange 2013 and later version.

    FolderSchema.DisplayName, you can't rely on display name due to many reasons.

    Thursday, April 18, 2013 2:59 PM