How to Batch Change All Contacts Folders to Show Total Number of Items via Outlook VBA

Unlike mail folders, the items in Contacts folders have no attribute about “read” or “unread”. Therefore, many users wish to let Contacts folders show total number of its items rather than number of unread items. Now, this article will share a method to batch process all Contacts folders.

By default, all Outlook folders show the number of unread items only. However, since the contacts don’t have the property of “read” or “unread”, you may want to change all Contacts folders to show total number of its items. To process a single folder, it is pretty easy. Just right click on the folder and select “Properties”. In the popup dialog box, check the “Show total number of items” option. But, if you have many Contacts folders in your Outlook, processing them one by one is too tedious. Thus, here we will teach you a method to batch process them.Show total number of items

Change All Contacts Folders to Show Total Number of Items

  1. At the very outset, launch Outlook VBA editor according to “How to Run VBA Code in Your Outlook“.
  2. Then, in the new window, put the following VBA code in an unused module.
Sub ShowTotalNumberOfItems()
    Dim objStores As Outlook.Stores
    Dim objStore As Outlook.Store
    Dim objOutlookFile As Outlook.Folder
    'Process all Outlook data files
    Set objStores = Outlook.Application.Session.Stores
    For Each objStore In objStores
        Set objOutlookFile = objStore.GetRootFolder
        Call ProcessFolders(objOutlookFile.Folders)
    MsgBox "Complete!", vbInformation + vbOKOnly
End Sub

Sub ProcessFolders(ByVal objFolders As Outlook.Folders)
    Dim objFolder As Outlook.Folder
    For Each objFolder In objFolders
        'If the folder is Contacts folder
        If objFolder.DefaultItemType = olContactItem Then
           'Show total number of items
           objFolder.ShowItemCount = olShowTotalItemCount
           'Process all subfolders recursively
           If objFolder.Folders.Count > 0 Then
              Call ProcessFolders(objFolder.Folders)
           End If
        End If
End Sub

VBA Code - Change All Contacts Folders to Show Total Number of Items

  1. Next, move your cursor into the first subroutine.
  2. Eventually, press “F5” key button to run this macro.
  3. When macro completes, in Outlook main window, go to Contacts navigation pane.
  4. There you can see that all Contacts folders are showing the total number of its items, like the following screenshot.All Contacts Folders Showing Total Number of Items

Don’t Let Your Outlook File Oversized

The larger your Outlook file, the more vulnerable it will be. Therefore, in order to avoid Outlook data corruption, you’re required to keep your Outlook file in small size. Otherwise, once your Outlook data is corrupt, you will make efforts to repair PST. Under this circumstance, you can firstly try the inbox repair tool. If it fails to help you, you can proceed to utilize a powerful external one, such as DataNumen Outlook Repair.

Author Introduction:

Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including sql recovery and outlook repair software products. For more information visit

Comments are closed.