Missing Function?!

Hi,
1.Here:

Save contacts information from PST file in MSG Format
Call the PersonalStorage.ExtractContactInfo() method

Can you please confirm where’s this method? I mean using v22.9 this function does not exists at all. Perhaps it’s hidden by mistake?

  1. While extracting the whole Pst/Ost file:
    For Each MyFolder As Pst.FolderInfo In Pst.RootFolder.GetSubFolders

How to find if MyFolder is which StandardIpmFolder type?
ie, need to confirm if MyFolder = StandardIpmFolder.Inbox etc?
Thanks.

@australian.dev.nerds

We have logged this issue as EMAILNET-40777 in our issue tracking system.

Could you please share some more detail about this requirement?

Hi,
You suggested to use:
pst.GetPredefinedFolder(StandardIpmFolder.Blah)
To get the Blah folder

I mean when I’m reading all folders using:
For Each MyFolder As Pst.FolderInfo In Pst.RootFolder.GetSubFolders

At this state, how to find which folder type is MyFolder?
For example to check if MyFolder is Inbox or Contacts etc?

  • To compare if Pst.FolderInfo is which StandardIpmFolder type?

Thanks :slight_smile:

@australian.dev.nerds

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.

Hi
If MyStorage.GetPredefinedFolder(Email.Storage.Pst.StandardIpmFolder.Contacts).DisplayName = MyFolder.DisplayName Then…

The problem is that, “Calendar” might have sub folders, those sub folders are not detected as “Calendar” folder using this method :frowning:

@australian.dev.nerds

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.

Hi,
First of all, in this help page:

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

Thanks :slight_smile:

@australian.dev.nerds

We logged this issue as EMAILNET-40777.

We have logged this requirement as EMAILNET-40783. You will be informed once there is an update available on it.

@australian.dev.nerds,

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());
    }
}
1 Like

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 :smiley:

@australian.dev.nerds

I tried to find it, but I do not remember such a function. Perhaps this is some kind of confusion in the documentation :thinking:

Thanks.

1 Like