Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Performance Tuning
#5
Hi Ken,
I based this code on this snippet from: http://www.freevbcode.com/ShowCode.asp?ID=1469

Macro GetUnreadMessagesInInboxVBA
Code:
Copy      Help
typelib Outlook {00062FFF-0000-0000-C000-000000000046} 9
Outlook.Application oOutlook._getactive
Outlook.NameSpace oNS
Outlook.MAPIFolder oFldr
oNS = oOutlook.GetNamespace("MAPI")
oFldr = oNS.GetDefaultFolder(olFolderInbox)
;;;;MAPIFolder  GetDefaultFolder(FolderType)   ;;FolderType: olFolderDeletedItems olFolderOutbox olFolderSentMail olFolderInbox olFolderCalendar olFolderContacts olFolderJournal olFolderNotes olFolderTasks olFolderDrafts olPublicFoldersAllPublicFolders olFolderConflicts olFolderSyncIssues olFolderLocalFailures olFolderServerFailures olFolderJunk olFolderRssFeeds olFolderToDo olFolderManagedEmail olFolderSuggestedContacts
int UnreadMessagesInInbox = oFldr.UnReadItemCount
mes F"UnreadMessagesInInbox = {UnreadMessagesInInbox}"
Hopefully this works for you - I used the TypeLibrary Search to get the declaration.
S


Messages In This Thread
Performance Tuning - by ken gray - 10-25-2018, 05:10 PM
RE: Performance Tuning - by Gintaras - 10-25-2018, 05:55 PM
RE: Performance Tuning - by ken gray - 10-25-2018, 08:26 PM
RE: Performance Tuning - by ken gray - 10-26-2018, 12:49 PM
RE: Performance Tuning - by stupomer - 10-28-2018, 09:21 PM
RE: Performance Tuning - by BJ - 12-07-2018, 08:37 PM
RE: Performance Tuning - by stupomer - 12-10-2018, 03:27 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)