A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Count the No of Mails



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old November 16th 06, 10:15 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default 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.


  #2  
Old November 17th 06, 02:40 AM posted to microsoft.public.outlook.program_vba
Avadivelan TCS
external usenet poster
 
Posts: 8
Default 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.



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Count Backward Barbara B. Outlook - Calandaring 1 September 6th 06 06:59 PM
Count dates [email protected] Outlook and VBA 7 August 10th 06 05:13 PM
Recurring Days That Count Up Ron Anthony Quinn Outlook - Calandaring 0 May 10th 06 07:37 PM
How can I count how many contacts I have ? How can I count how many contacts I have Outlook - Using Contacts 1 May 4th 06 10:24 PM
count contacts ems@drg Outlook - Using Contacts 1 February 23rd 06 06:54 PM


All times are GMT +1. The time now is 08:31 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-2025 Outlook Banter.
The comments are property of their posters.