Reputation: 2923
I've used MAPI on a project recently to traverse mailboxes and export them to .msg files so I know a bit but I would now like to efficiently count all the folders inside a mailbox. Can this be done with MAPI tables somehow? Is there a magic property for this? Any help will be appreciated.
Upvotes: 0
Views: 524
Reputation: 66235
Normally you only get the immediate child folders. You can pass CONVENIENT_DEPTH flag to get all child folders returned. If I remember correctly, that will only work with the online Exchange stores (both mailbox and PF).
Upvotes: 1
Reputation: 966
Open the message store using OpenMsgStore function and then open top of information store using HrOpenFolderEx and then use GetHierarchyTable to get the list of folders
Upvotes: 1