I also faced this problem recently (Favorites from a shared mailbox always disappeared), and solved it by using a VBA procedure that runs automatically every time you launch Outlook. This of course works best if you have static Favorite folders.
So, in Outlook, proceed as follows:
- Enable Developer menu
- right-click a menu item and choose Customize the Ribbon...
- in the right column, under Main Tabs, check the Developer item
- Choose Developer > Visual Basic
- the Microsoft Visual Basic for Applications windows is opened
- click the plus signs in front of Project1 > Microsoft Outlook Objects > ThisOutlookSession
- By putting your code in this location
- and by naming your procedure Application_Startup(),
it will be executed every time you launch Outlook (see the procedure below)
- double-click ThisOutlookSession (or right-click it and choose View Code)
- make sure macros are enabled in Outlook:
- Developer > Macro Security
- choose Enable all macros (...)
- 2 x OK
- close and re-open Outlook
- et voilà
And then the procedure itself:
- lines 16 & 17 are examples of default folders - uncomment them if you want to use folders from the default Inbox
- an overview of the default folder names can be found here: https://www.slipstick.com/developer/working-vba-nondefault-outlook-folders
- lines 21 & 21 are examples of folders from an Outlook Data File (.pst or .ost), simply use the readable names of the mailbox and the folder(s)
Private Sub Application_Startup()
Dim objNamespace As NameSpace
Dim objInbox As Folder
Dim objPane As NavigationPane
Dim objModule As MailModule
Dim objGroup As NavigationGroup
Dim objNavFolder As NavigationFolder
On Error GoTo ErrRoutine
' First, retrieve the default Inbox folder.
Set objNamespace = Application.GetNamespace("MAPI")
' default folders
' Set objInbox = objNamespace.GetDefaultFolder(olFolderInbox)
' Set objSentMail = objNamespace.GetDefaultFolder(olFolderSentMail)
' folders from shared mailbox or Outlook Data File (.pst or .ost)
' Simply use the readable names of the mailbox and the folders in the below lines:
Set objInbox = objNamespace.Folders("My old mailbox").Folders("Postvak IN")
Set objSentMail = objNamespace.Folders("My old mailbox").Folders("Verzonden items")
' Get the NavigationPane object for the currently displayed Explorer object.
Set objPane = Application.ActiveExplorer.NavigationPane
' Get the mail module from the Navigation Pane.
Set objModule = objPane.Modules.GetNavigationModule(olModuleMail)
' Get the "Favorite Folders" navigation group from the mail module.
With objModule.NavigationGroups
Set objGroup = .GetDefaultNavigationGroup(olFavoriteFoldersGroup)
End With
' Add the folders you have selected above, to the "Favorite Folders" navigation group.
Set objNavFolder = objGroup.NavigationFolders.Add(objInbox)
Set objNavFolder = objGroup.NavigationFolders.Add(objSentMail)
EndRoutine:
On Error GoTo 0
Set objNavFolder = Nothing
Set objGroup = Nothing
Set objModule = Nothing
Set objPane = Nothing
Set objNamespace = Nothing
Exit Sub
ErrRoutine:
MsgBox Err.Number & " - " & Err.Description, _
vbOKOnly Or vbCritical, _
"AddToFavoritesFolder"
End Sub