hi all
can any one help me how count number of msgs in inbox in outlook application
looking for lots of replies
thanks
parthi
Printable View
hi all
can any one help me how count number of msgs in inbox in outlook application
looking for lots of replies
thanks
parthi
Give this a try:
Make sure to set a reference to the MS Outlook object library, then
declare the following:
And this sub should find the inbox's item count:Code:Private colApp As Outlook.Application 'withevents is allowed
Private colNameSpace As Outlook.NameSpace
Private colFolders As Outlook.MAPIFolder
Code:Private Sub GetInboxTotal()
Set colApp = CreateObject("Outlook.Application")
Set colNameSpace = colApp.GetNamespace("MAPI")
Set colFolders = colNameSpace.GetDefaultFolder(olFolderInbox)
InboxTotal = colFolders.Items.Count
Set colFolders = Nothing
Set colNameSpace = Nothing
colApp.Quit
Set colApp = Nothing
End Sub