Results 1 to 2 of 2

Thread: to find no new msg arrived in outlook

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2001
    Location
    bkk
    Posts
    224

    to find no new msg arrived in outlook

    hi all
    can any one help me how count number of msgs in inbox in outlook application
    looking for lots of replies
    thanks
    parthi

  2. #2
    Hyperactive Member
    Join Date
    May 2002
    Location
    Chicago
    Posts
    271
    Give this a try:
    Make sure to set a reference to the MS Outlook object library, then
    declare the following:
    Code:
    Private colApp As Outlook.Application 'withevents is allowed
    Private colNameSpace As Outlook.NameSpace
    Private colFolders As Outlook.MAPIFolder
    And this sub should find the inbox's item count:
    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
    Sometimes what you're looking for is exactly where you left it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width