*Check for unread messages in the Inbox
*Compruebe si hay mensajes no leídos en la Bandeja de entrada
Function mail_not_read
Local oOutlookObject,olNameSpace
#Define olFolderInBox 6
oOutlookObject = Createobject('Outlook.Application')
olNameSpace = oOutlookObject.GetNameSpace('MAPI')
oItems= olNameSpace.GetDefaultFolder(olFolderInBox).Items
For Each loItem In oItems
?loItem.unRead
If loItem.unRead
*Do something here
loItem.unRead = .F. && <---- Mark it as read
Endif
Next
Return