Sub CountInbox()
Dim olApp As Outlook.Application
Dim olNs As NameSpace
Dim Fldr As MAPIFolder
Set olApp = New Outlook.Application
Set olNs = olApp.GetNamespace("MAPI")
Set Fldr = olNs.GetDefaultFolder(olFolderInbox)
MsgBox Fldr.Items.Count
Set Fldr = Nothing
Set olNs = Nothing
Set olApp = Nothing
End Sub