Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Forms / August 2004

Tip: Looking for answers? Try searching our database.

mark as read

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
An Dong - 19 Aug 2004 10:57 GMT
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
Sue Mosher [MVP-Outlook] - 19 Aug 2004 14:09 GMT
You need to omit the seconds element in your restriction string. See
http://www.outlookcode.com/d/finddate.htm

Your code below also omits an important statement:

   MyItem.Save

Signature

Sue Mosher, Outlook MVP
Author of
    Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx

> Hello Sue,
> I'm very sorry I annoy you one more time. In spite of the
[quoted text clipped - 31 lines]
> Once again thank you very much for your help
> AnDOng
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.