FYI
We have observed PSTs which return misleading information for the following 2 properties:
- FolderInfo.HasSubFolders
- FolderInfo.ContentCount
These were returning false and 0 respectively. However, if we call FolderInfo.GetContents() and FolderInfo.GetSubFolders() we can see that the folder has items and subfolders.
On closer inspection, the following both returned null:
- folderInfo.Properties[MapiPropertyTag.PR_CONTENT_COUNT];
- folderInfo.Properties[MapiPropertyTag.PR_SUBFOLDERS];
So it seems like the PST in question is not 100% standard. It is my understanding that the PST was generated by a 3rd party tool.
Whether FolderInfo.HasSubFolders and FolderInfo.ContentCount should return the values they did in the absence of the underlying MAPI property is questionable. I am not sure what Aspose.Email should have done in this situation. Even if they both these properties existed I guess that there is no guarantee that they are accurate. The 3rd party vendor that created the PST could have set them to anything. One option would be for Aspose.Email to provide some sort of warnings/notifications if there are missing properties.
Opening the PST in Outlook shows the subfolders and items, so it seems like Outlook isn’t relying on those properties.
Anyway I have posted this here in case others come across this situation and as a hint for others to not rely 100% on HasSubFolders and ContentCount.