Mark email as read

  • Thread starter Thread starter Fausto Richetti Blanco
  • Start date Start date
F

Fausto Richetti Blanco

I use some email messages, with a specific subject, to control a
workflow
system in outlook. So, these emails are consumed by the application on
the
NewMail event and deleted. But the email remain as unread and in the
trash
folder...
Is there a way to mark these emails as read or, if possible,
definitively
delete the messages (ie.: remove them from the trash folder) ?
 
Try releasing your reference to the object and getting it back from the
EntryID and then marking it read twice.

To delete an item permanently without hitting the Deleted Items folder you
would have to delete it using CDO 1.21 or Extended MAPI or Redemption
(www.dimastr.com/redemption). Or you could iterate the Deleted Items folder
and delete all items or yours using code.
 
Thanks, the following code solved my problem:
For Each auxDeletedItem In
hndOutlook.GetNamespace("MAPI").GetDefaultFolder(olFolderDeletedItems).Items
If (auxDeletedItem.Class = olMail) Then
If (auxDeletedItem.Subject = ctrlSubject) Then
auxDeletedItem.Delete
End If
End If
Next
 
Back
Top