Detect read messages count changed

X

xhantt

Is there a way to detect when a message has been read from a folder.

I try this

Dim ol As Outlook.Application
Dim ns As Outlook.NameSpace
Dim WithEvents folders As Outlook.folders

Private Sub Command1_Click()
Set ol = New Outlook.Application
Set ns = ol.GetNamespace("MAPI")
Set folders = ns.GetDefaultFolder(olFolderInbox).folders
End Sub


Private Sub folders_FolderChange(ByVal Folder As Outlook.MAPIFolder)
unread = Folder.UnReadItemCount
End Sub

It work fine with messages inside subfolders of Inbox, but not with the
messages from Inbox.

Also there's a way to detect which change triggered the event?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top