Folder.ShowItemCount Property (Outlook)

Office 2013 and later

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Sets or returns a constant in the OlShowItemCount enumeration that indicates whether to display the number of unread messages in the folder or the total number of items in the folder in the Navigation Pane. Read/write.

expression .ShowItemCount

expression A variable that represents a Folder object.

The ShowItemCount property does not work with Public Folders.

This Microsoft Visual Basic for Applications (VBA) example displays the unread count for the Inbox in the Navigation Pane.

Sub ShowTotalItemCount() 
 Dim nmsName As Outlook.NameSpace 
 Dim fldFolder As Outlook.Folder 
 Set nmsName = Application.GetNamespace("MAPI") 
 Set fldFolder = nmsName.GetDefaultFolder(olFolderInbox) 
 fldFolder.ShowItemCount = olShowUnreadItemCount 
End Sub


Other resources