mark as read

A

An Dong

Hello Sue,
I'm very sorry I annoy you one more time. In spite of the
introduction, this message is about forms, so please read it all :°)
I want the messages I sent to be automatically moved to specific
folders. But rules just allow to copy them, and the copy is not marked
as read, wich is a big problem. I tried AutoRead but it's not free
:(. Since I created a custom form that I use as default mail form, I
though I could find a mean by this. Good thing, I had rules for
incoming messages already created. So I decided to automatically send
a copy to myself each time a send a mail. This copy matches the rules,
goes to the right folder and i just have to mark it as read.
When I send my e-mail, I wait 8s before lunching my function which
loops through the last received mails to find the one I just sent.
Everything is OK except one piece of code : i can't find the write
syntax for Item.Restric :

Function MarkAsRead()
Dim myItem
Set myNameSpace = Application.GetNameSpace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder(6) '6 means inbox
Set myItems = myFolder.Items
Set myRestricItems = myItems.Restrict("[ReceivedTime] = '" & Now() -
8000 & "'")
' this was the pb. I want to restrict myItems to the one arrived in
the
' 8 last secondes
On Error Resume Next
For Each myItem In myItems
If myItem.To = "HUBERT Antoine" Then
myItem.UnRead = False
End If
Next

Once again thank you very much for your help
AnDOng
 

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