The PersonalStorage.GetPredefinedFolder method returns a FolderInfo object that represents a standard IPM folder. You can use FolderInfo.DisplayName property to get and compare folder’s names.
Could you please share complete detail of your use case with test example along with expected output? We will then log your requirement in our issue tracking system.
You mentioned: Call the PersonalStorage.ExtractContactInfo() method
While PersonalStorage.ExtractContactInfo does not exists at all
So where’s the ExtractContactInfo method?
2nd, I’m extracting the whole Pst/ Ost file in such loop:
For Each MyFolder As Email.Storage.Pst.FolderInfo In InputFolders
For Each MyMSG As Email.Mapi.MapiMessage In MyFolder.EnumerateMapiMessages
'How to find if MyMSG is in Calendar folder or not? You said:
If MyStorage.GetPredefinedFolder(StandardIpmFolder.Contacts).DisplayName = MyFolder.DisplayName Then…
Next
Next
The problem is here when my Calendar has sub folders like:
Root - Mailbox\IPM_SUBTREE\Calendar\United States holidays
Using the above method, all Calendar items because reside under “United States holidays” folder, are not detected as Calendar items
Added StandardIpmFolder FolderInfo.GetPredefinedType(bool getForTopLevelParent) method, to check folder is from StandardIpmFolder.
If getForTopLevelParent param is true, returns a StandardIpmFolder enum value for the top-level parent folder. This determines whether the current folder is a subfolder of a predefined folder.
If getForTopLevelParent param is false, it returns a StandardIpmFolder enum value for the current folder.
string fileName = "my.pst");
using (var pst = PersonalStorage.FromFile(fileName))
{
CheckFolders(pst.RootFolder.GetSubFolders());
}
private void CheckFolders(FolderInfoCollection folders)
{
foreach (var folder in folders)
{
Console.WriteLine($"Display Name: {folder.DisplayName}");
// Determines whether the current folder is a predefined folder
var folderType = folder.GetPredefinedType(false);
var answer = folderType == StandardIpmFolder.Unspecified ? "No" : $"Yes, {folderType}";
Console.WriteLine($"Is StandardIpmFolder?: {answer}");
// Determines whether the current folder is a subfolder of a predefined folder
if (folderType == StandardIpmFolder.Unspecified)
{
folderType = folder.GetPredefinedType(true);
answer = folderType == StandardIpmFolder.Unspecified ? "No" : $"Yes, {folderType}";
Console.WriteLine($"Is subfolder from StandardIpmFolder parent?: {answer}");
}
Console.WriteLine();
CheckFolders(folder.GetSubFolders());
}
}
Thanks so much for the new feature, anyhow, what was the hidden PersonalStorage.ExtractContactInfo()?
It’s now removed from the help, just am curious what was that, I’d love hidden/secret things
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.