0

in the navigation pane in Outlook 2016 I can right-click a sub-folder and select "move up" or "move down" to change the order. But I can't find the corresponding VBA command to do this. Does anyone have an idea where to look? (It's not in Outlook.Folder or Outlook.View, which were my first guesses)

So far I have this:

    Sub MoveToTop(newFolderName as String)
      Dim nsp As Outlook.NameSpace
      Dim newFolder As Outlook.Folder
      Dim rootFolder as Outlook.Folder

      Set nsp = Application.GetNamespace("MAPI")
      Set rootFolder = ns.GetDefaultFolder(olFolderInbox)
      Set newFolder = rootFolder.Items.Find (newFolderName)

      'now I need something like:
      newFolder.MoveUp
    End Sub

I am missing the link between the view in the navigation pane and the folders in the MAPI namespace

Thanks a lot,

Bjoern

BjoernF
  • 1
  • 2
  • Based on this [answer](https://stackoverflow.com/questions/38868038/outlook-2013-outlook-2016-vba-rearrange-folders-in-folders-tree?rq=1), it seems like you need to manipulate the `PR_SORT_POSITION` property. – Raymond Wu Nov 12 '21 at 10:04
  • Thanks Raymond! This is a path I didn't even know existed until now. I am looking into it right now, trying to find the right property for my problem – BjoernF Nov 12 '21 at 12:50

0 Answers0