Question

I am exporting all the e-mails from folder and sub-folder of exchange server, i am able to get all the folder and its mails using the link, (answer ofono2012)

How To Get all ITEMS from Folders and Sub-folders of PublicFolders Using EWS Managed API

but i am not able to get, which folder was whose sub-folder, means not able to get folder hierarchy

please help

Was it helpful?

Solution

You'll have to do a separate FindFolder operation to get the folder hierarchy:

http://msdn.microsoft.com/en-us/library/office/dd633627(v=exchg.80).aspx

Make sure to include view.Traversal = FolderTraversal.Deep; and do

view.PropertySet = new PropertySet(BasePropertySet.IdOnly);
view.PropertySet.Add(FolderSchema.DisplayName);
view.PropertySet.Add(FolderSchema.ParentFolderId);

to get the full hierarchy of relationships. You should then be able to match the ParentFolderId from the items to the folder ids.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top