ShowItemCount Property

Sets or returns an OlShowItemCount constant 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.

The OlShowItemCount constant can be one of the following:

  • olShowNoItemCount (0)
  • olShowUnreadItemCount (1)
  • olShowTotalItemCount (2)

expression.ShowItemCount

*expression   * Required. An expression that returns one of the objects in the Applies To list.

Remarks

The ShowItemCount property does not work with public folders.

Example

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

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

Applies to | MAPIFolder Object