Count the No of Mails

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi ..!

How to count the no of mails in the INBOX?
Is there any syntax for shows no of mails in the INBOX?

Thanks in advance for your reply.
 
Do you mean getting the count in code? Any folder's Items collection has a
Count property that you can use.
 
Dear Ken Slovak,

Ya, I need the code.

Ken Slovak - said:
Do you mean getting the count in code? Any folder's Items collection has a
Count property that you can use.
 
This would only run in Outlook VBA, any other platform would need somewhat
different code:

Sub InboxItemsCount()
Dim oFolder As Outlook.MAPIFolder
Dim lngCount As Long

Set oFolder =
Application.GetNameSpace("MAPI").GetDefaultFolder(olFolderInbox)
lngCount = oFolder.Items.Count

MsgBox "Count of items in Inbox = " & lngCount
End Sub
 
Back
Top