Outlook Folder Order

Add-in Express™ Support Service
That's what is more important than anything else

Outlook Folder Order
 
Nevzat Hayri TAVUK?U




Posts: 30
Joined: 2019-12-19
I created a folder named abcd. I want to sort the folders within the abcd folder. type of abcd folder MAPIFolder.
The number of item in the Items property of the abcd folder is 0. The number of item in the Folders property of the abcd folder is 20. So I need to do folder sorting, not item sorting.

Folders property does not have sorting. Do I sort folders?

example of adding a folder:
mainFolder.Folders.AddFolder("abcde");
Posted 15 Jan, 2020 07:19:35 Top
Andrei Smolin


Add-in Express team


Posts: 18806
Joined: 2006-05-11
Hello Nevzat,

In the Outlook Explorer Ribbon, on the Folder tab, there's the button named "Show All Folders A to Z". Open the Customize Ribbon dialog and find the IdMso of that control. Check how I do this at https://www.add-in-express.com/forum/read.php?FID=5&TID=15768. Then invoke that control using CommandBars.ExecuteMso({the IdMso of the control to "click" here}). get the CommandBars object via Explorer.CommandBars. Make sure you release every COM object created in your code; in particular, the CommandBars object is a COM object.


Andrei Smolin
Add-in Express Team Leader
Posted 15 Jan, 2020 07:52:44 Top
Nevzat Hayri TAVUK?U




Posts: 30
Joined: 2019-12-19
I showed in the picture the folders I want to sort

User added an image
Posted 15 Jan, 2020 08:39:14 Top
Andrei Smolin


Add-in Express team


Posts: 18806
Joined: 2006-05-11
I assume your question is: how to sort them. If so, select the folder that it the parent folder for all these folders and click that button. In your case, you need to "click" it programmatically.

I've found one more button that can be of use. Its IdMso is "SortFoldersAtoZ".

I suggest that you check section Referring to Built-in Ribbon Controls; see the PDF file in the folder {Add-in Express}\Docs on your development PC. Use the information it provides plus what I gave you above to locate these buttons and find more buttons (if they exist).


Andrei Smolin
Add-in Express Team Leader
Posted 15 Jan, 2020 09:02:51 Top
Nevzat Hayri TAVUK?U




Posts: 30
Joined: 2019-12-19
do I relocate the folders that I show in a picture? for example, consider the "MSG Files", "Need Content" and "New Content" folders. I want the folder order to be "New Content", "MSG Files", "Need Content" respectively. there will only be a place change between three folders. how I do this after I add folders
Posted 16 Jan, 2020 02:11:02 Top
Andrei Smolin


Add-in Express team


Posts: 18806
Joined: 2006-05-11
Hello Nevzat,

I don't think it is possible to set folders in an arbitrary order programmatically. Should this be possible, you would find a built-in Ribbon control having "Folder" in its name in the list of built-in Ribbon controls in the Outlook Explorer Ribbon; see the manual.


Andrei Smolin
Add-in Express Team Leader
Posted 16 Jan, 2020 02:29:42 Top