Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   Count the No of Mails (http://www.outlookbanter.com/outlook-vba/33038-count-no-mails.html)

Avadivelan TCS November 16th 06 02:13 PM

Count the No of Mails
 
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.

Ken Slovak - [MVP - Outlook] November 16th 06 04:44 PM

Count the No of Mails
 
Do you mean getting the count in code? Any folder's Items collection has a
Count property that you can use.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Avadivelan TCS" wrote in message
...
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.



Avadivelan TCS November 16th 06 05:31 PM

Count the No of Mails
 
Dear Ken Slovak,

Ya, I need the code.

"Ken Slovak - [MVP - Outlook]" wrote:

Do you mean getting the count in code? Any folder's Items collection has a
Count property that you can use.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Avadivelan TCS" wrote in message
...
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.




Ken Slovak - [MVP - Outlook] November 16th 06 10:15 PM

Count the No of Mails
 
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

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Avadivelan TCS" wrote in message
...
Dear Ken Slovak,

Ya, I need the code.



Avadivelan TCS November 17th 06 02:40 AM

Count the No of Mails
 
Dear Ken Slovak,

Thanks a lot, It's working .. Have a nice day.

"Ken Slovak - [MVP - Outlook]" wrote:

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

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Avadivelan TCS" wrote in message
...
Dear Ken Slovak,

Ya, I need the code.





All times are GMT +1. The time now is 08:24 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com