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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top