Grewal
Grewal

Reputation: 21

VSTO Outlook Add-in Move folders up and down

i have an outlook add-in in which a folder is selected.Now what i want is, i want to move the folder up and down using C#. Is there someone that can help me in this case. You help is greatly appreciated.

Upvotes: 1

Views: 185

Answers (2)

Dmitry Streblechenko
Dmitry Streblechenko

Reputation: 66215

You will need to set the PR_SORT_POSITION Extended MAPI property using MAPIFolder.PropertyAccessor.SetProperty. You can see that property (if the particular folder was manually reordered) in OutlookSpy (I am its author - click IMAPIFolder button).
See https://blogs.msdn.microsoft.com/stephen_griffin/2013/11/08/mapi-provider-sorting/ for more details.

Upvotes: 2

Ubernator
Ubernator

Reputation: 743

To my knowledge you can not. Non-default folders are sorted alphabetically.

Upvotes: 0

Related Questions