G
Guest
I want to get all unread Outlook messages from an Access 2000 database. Using this code, numMailItems reflects the actual number of unread messages. However, the For...Next loop processes some of the unread messages and then stops, setting objMailItem to nothing. Any ideas
Set golApp = New Outlook.Applicatio
Set objFolder = gnspNameSpace.GetDefaultFolder(olFolderInbox
Set objRetainerItems = objItems.Restrict("[Unread] = True"
numMailItems = objRetainerItems.Coun
For Each objMailItem In objRetainerItem
' processing for each unread messag
Next objMailItem
Set golApp = New Outlook.Applicatio
Set objFolder = gnspNameSpace.GetDefaultFolder(olFolderInbox
Set objRetainerItems = objItems.Restrict("[Unread] = True"
numMailItems = objRetainerItems.Coun
For Each objMailItem In objRetainerItem
' processing for each unread messag
Next objMailItem