'How to reorder Outlook PST mailbox/store in folder pane?

I'm using Outlook 2016 and I have two PST files listed below my default Exchange mailbox/store. In the Folder Pane, I can click and drag the PST mailbox/store above the other PST and default mailbox/store. For instance, if this is my current Folder Pane:

[email protected]    (Default Exchange mailbox/store)
Mail2019                            (PST #1)
Mail2020                            (PST #2)

I'm able to click and drag Mail2020 above Mail2019, so the Folder Pane looks like this:

[email protected]    (Default Exchange mailbox/store)
Mail2020                            (PST #2)
Mail2019                            (PST #1)

Is it possible to reorder the mailboxes/stores in the Folder Pane using VBA and, if so, how? I've searched through the Outlook Object Model properties, the MAPI properties, and explored the mailboxes/stores using MFCMAPI, but have yet to find anything that appears to store the order.

Thanks.



Solution 1:[1]

The store order list is stored in the 0x04581102 multivalued binary property (PT_MV_BINARY) in the IID_CAPONE_PROF profile section - you can see it in OotlookSpy (I am its author): click IMAPISession button on the OutlookSpy ribbon, click OpenProfileSection, select "{00020D0A-0000-0000-C000-000000000046} IID_CAPONE_PROF", click OK, scroll down to the 0x0458 property.

Keep in mind that the property is only present if the user explicitly reordered the list of stores. Otherwise the stores are ordered in the alphabetical order with the default store (no matter its name) being first (from what I can tell).

If using Redemption (I am also its author) is an option, there are plans to expose this functionality in the next version of Redemption (5.23) through the RDOStore2.DisplayOrder property and RDOStores.GetOrder list. If you are interested, send an email to redemption (at) dimastr (dot) com.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1