How do I get the folders in the same order as they appear in Outlook?
I am using this code to get the folders:
static void Main(string[] args)
{
var outlookApp = new Microsoft.Office.Interop.Outlook.Application();
var ns = outlookApp.GetNamespace("MAPI");
var folder = ns.Folders[2];
Console.WriteLine($"+++ {folder.Name} +++");
foreach (Microsoft.Office.Interop.Outlook.Folder subFolder in folder.Folders)
{
Console.WriteLine(subFolder.Name);
}
}
Then I get this list of results:

However, in Outlook they are displayed in this order:
