Log inRegister
You are here: Boossy » Software » SwMicrosoft » MsOffice » MsOutlook

Microsoft Outlook

Make sure favorite folders always appear

Also and especially if they're not in your default mailbox!
  • 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
    1. By putting your code in this location
    2. 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:
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 and .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)
     On Error GoTo 0
     Set objNavFolder = Nothing
     Set objGroup = Nothing
     Set objModule = Nothing
     Set objPane = Nothing
     Set objNamespace = Nothing
     Exit Sub
     MsgBox Err.Number & " - " & Err.Description, _
         vbOKOnly Or vbCritical, _
 End Sub

Export to an Outlook Data File (.pst)

Every 10 years (...) I make a backup of my mailbox.

Nowadays, I check my mail through webmail, but I still have an email account configured in Outlook, of the IMAP/SMTP type.

If you want to export your mailbox, no problem:
  • launch Outlook
  • File > Open & Export > Import/Export
  • Import and Export Wizard window:
    • Choose an action to perform: Export to a file
    • Next >
    • Create a file of type: Outlook Data File (.pst)
    • Next >
    • Select the folder to export from, check the Include subfolders checkbox if wanted
    • Next >
    • Save exported file as: E:\nter\The\Desired\FileName.pst
    • Finish
  • Create Outlook Data File window:
    • You can enter a password, if wanted
    • OK
  • Wait for the export to complete and you'll find your .pst file in the indicated location.
Now, the tricky part is reading the .pst file.
  • again, in Outlook
  • File > Open & Export > Open Outlook Data File
  • choose your .pst file
  • in the Folder Pane, an Outlook Data File item appears
  • uncollapse this item and choose a message folder (e.g. Inbox), you'll always see: We didn't find anything to show here.
Apparently, that's because you exported an IMAP type mailbox, then the messages marked for deletion are hidden...
  • So, with a message folder selected, click the View menu > Change View
  • instead of 'Hide Messages Marked for Deletion', choose Preview
  • the messages in the folder now appear
  • if there are subfolders, however, they'l still state We didn't find anything to show here
  • Now return to the message folder you've already corrected, and in the View menu, now choose once again Change View
  • now choose Apply Current View to Other Mail Folders...
  • check all desired message folders and check the Apply view to subfolders checkbox if necessary
  • now check the subfolders again, and you'll see the messages.
That's it!


With the above procedure, I created a backup of my Telenet mailbox 2010-2020, but I didn't clean my mailbox.

On 27/07/2023, the webmail started to show a red bar, indicating my mailbox was over 85% full.

Then I searched for mails sent before 01/01/2020, and deleted them (to the recycle bin).
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback
This page was cached on 04 Jun 2024 - 23:05.