none
ExchangeService (EWS Managed API) accessing favorites / Shortcuts RRS feed

  • Question

  • Hi,

    currently I am playing a bit with EWS. And I havent found out how do I access the favorites folders.

    I noticed that favorites are stored int "Root Container\shortcuts" when I open it with MFC MAPI. From there I can open the Contents table in order to see all shortcuts I have made plus some additional sub folders.

    The only thing I need is of course the name of the shortcut item (which is stored in  http://schemas.microsoft.com/mapi/proptag/0x7C00001E) and reference to its destination.

    Can some please support me in getting http://schemas.microsoft.com/mapi/proptag/0x7C00001E with EWS Managed API properly?

    I already tried

    ExtendedPropertyDefinition ShortcutName = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.PublicStrings, "http://schemas.microsoft.com/mapi/proptag/0x7C00001E", MapiPropertyType.String);

    without success

    Any ideas?
    Thursday, August 18, 2011 2:56 PM

Answers

  • Hi,

     

    Guess I found my own solution by converting thr property "0x7C02" (PR_FAV_PUBLIC_SOURCE_KEY) to an EntryId and then using EWS class Folder.Bind(service, HexEntrIdToEWSId) to receive the correct folder.

    converting it to the EntryId was most difficult part because it is a combination of pbLongTermNonPrivateGuid, FolderType, PREFIX , SUFFIX plus the PR_FAV_PUBLIX_SOURCE_KEY.

     

    Regards,

    Ole

    • Marked as answer by Ole K Tuesday, August 23, 2011 8:10 AM
    Tuesday, August 23, 2011 8:10 AM

All replies

  • This not a named property if you want to know the difference between named properties and a tagged property firstly have a read of http://msdn.microsoft.com/en-us/library/cc815528.aspx . So you should have something like

    ExtendedPropertyDefinition ShortcutName = new ExtendedPropertyDefinition(31744, MapiPropertyType.String);

    Cheers
    Glen

    Friday, August 19, 2011 4:04 AM
  • I remember I tried this already.

    But when I use

    ExtendedPropertyDefinition ShortcutName = new ExtendedPropertyDefinition(0x7C00001E, MapiPropertyType.String);


    it throws an exception: "The extended property tag value must be the range of 0 to 65,535".

    So not possible receiving this proptag with EWS?

    Thank you

    Friday, August 19, 2011 8:18 AM
  • If your going to use the property identifier in Hex format you only need to use the first 4 hex digits which is the actually PropertyID the last 4 hex digits refers to the datatype eg 0001E in Mapi tells you that this is a String. So use (or the decimal equivalent which is what i posted before   )

    ExtendedPropertyDefinition ShortcutName = new ExtendedPropertyDefinition(0x7C00, MapiPropertyType.String);

    Cheers
    Glen

    Friday, August 19, 2011 9:36 AM
  • Thank you...

    There is one more question about EWS and favorites... how do I resolve PR_SOURCE_KEY with Exchange Webservices?

     

     

    Friday, August 19, 2011 1:41 PM
  • Depends what you mean by resolve ? if you want to access this property value on an Item use the Extended property for this, otherwise you can't use it directly like you could use in Mapi if your trying to access an Item from only the SourceKey (if you have the PR_EntryID then you can use the convertID operation to convert this to a EWSId that you could then get the Item with). You can use it in a SearchFilter to find an item with in a particular folder with that property value.

    Cheers
    Glen

    Monday, August 22, 2011 3:18 AM
  • Hi Glen,

    I am trying to resolve a folder (not an item). I remember in WEbDav for exchange there is a PROPFIND method (http://msdn.microsoft.com/en-us/library/aa142960%28v=exchg.65%29.aspx) which provides a "over all search" to find a specific folder based on its SOURCE_KEY by using -FlatUrlSpace- (http://msdn.microsoft.com/en-us/library/ee237541%28v=exchg.80%29.aspx)

    Would it b possible to do the similar thing with EWS (Managed API)?

    I have also noticed the Folderview has a property called Traversal. But it does not work for Pf at all and comes up with an error:

    FolderView view = new FolderView(int.MaxValue);
    view.Traversal = FolderTraversal.Deep;
    
    FindFoldersResults r2d2 = service.FindFolders(WellKnownFolderName.PublicFoldersRoot, new SearchFilter.IsEqualTo(FolderSchema.DisplayName, "PF Name"), view);
    

    Exception: Deep traversal queries are not allowed on public folders.


    Monday, August 22, 2011 7:24 AM
  • >I am trying to resolve a folder (not an item). I remember in WEbDav for exchange there is a PROPFIND method (http://msdn.microsoft.com/en-us/library/aa142960%>28v=exchg.65%29.aspx) which provides a "over all search" to find a specific folder based on its SOURCE_KEY by using -FlatUrlSpace- (http://msdn.microsoft.com/en->us/library/ee237541%28v=exchg.80%29.aspx)

    No this was all part of the DAV extensions which are no longer available on Exchange 2010

    You can't do a deep traversal of Public folder tree (you couldn't do this Dav either) so you need to either search for it based on the path (eg if you have the path you can split out the components and find and search based on these) this is what i do when working with public folders.

    If you are using 2010 then you might want to take a look at using remote powershell cmldets as these do provide some better access to enumeration of particular folders eg get-PublicFolder etc.

    Cheers
    Glen

    Tuesday, August 23, 2011 3:09 AM
  • Hi,

     

    Guess I found my own solution by converting thr property "0x7C02" (PR_FAV_PUBLIC_SOURCE_KEY) to an EntryId and then using EWS class Folder.Bind(service, HexEntrIdToEWSId) to receive the correct folder.

    converting it to the EntryId was most difficult part because it is a combination of pbLongTermNonPrivateGuid, FolderType, PREFIX , SUFFIX plus the PR_FAV_PUBLIX_SOURCE_KEY.

     

    Regards,

    Ole

    • Marked as answer by Ole K Tuesday, August 23, 2011 8:10 AM
    Tuesday, August 23, 2011 8:10 AM