>Local loOutlook As Outlook.Application >Local loNameSpace As Outlook.NameSpace >Local loInBox As Object >Local loMSG As Outlook.MailItem >Local lnUnRead As Integer >Local loAttach,llAttach > >#Define olFolderInBox 6 > >loOutlook = Createobject('Outlook.Application') && >loNameSpace = loOutlook.GetNamespace("MAPI") >loInBox = loNameSpace.GetDefaultFolder(olFolderInBox) >lnUnRead = 0 > >You can find out how many are unread by checking the UnreadCount property of the folder. To get the list of unread items, use the Restrict method with the parameter "[Unread] = true":
loMsgs = loInbox.Items loUnread = loMsgs.Restrict("[Unread] = true")To mark an item as read, change its Unread property.