When using with Outlook folders the navigation tree can show either how many unread items it contains or how many items it contains. The read-unread status of a message is fragile and not very useful. The number of items in a folder on the other hand is very useful information. Unfortunately the default for newly created folders is the "unread" version. You can probably change this setting somewhere in the registry, but I have not found this (yet). In this post I present a different solution: creating a macro. Fortunately, in contrast to MS Word and PowerPoint enabling macros does not involve changing of file extensions. So you can use the macro yourself without much ado.
In my case I use my collection of email messages as my to-do list. To be more specific: if more than email message is connected to one and the same task I create a new folder in which I put all these emails. In the exceptional case that a task is not reflected in an email message I create a message that I sent to myself or I use "New Post in the Folder". As a result I end up with sometime ten new folders per day. And these show all the irritating number of unread items rather than the number of items as Microsoft determined that to be the default.
Of course I could correct this, one by one for each folder each time. This is cumbersome and irritating. So, I made a VBA script that does the job. Please find the script below.
Sub EnumerateFoldersInStores() ' store is a pst file Dim App As New Outlook.Application Dim Stores As Outlook.Stores Dim Store As Outlook.Store Dim Root As Outlook.Folder On Error Resume Next ' all pst files shown by Outlook session Set Stores = App.Session.Stores 'loop over folders in each pst file For Each Store In Stores Set Root = Store.GetRootFolder EnumerateFolders Root Next End Sub Private Sub EnumerateFolders(ByVal Root As Outlook.Folder) 'recursive function Dim Folders As Outlook.Folders Dim Folder As Outlook.Folder Dim Foldercount As Integer On Error Resume Next Set Folders = Root.Folders Foldercount = Folders.Count If Foldercount Then For Each Folder In Folders Folder.ShowItemCount = olShowTotalItemCount EnumerateFolders Folder Next End If End Sub