How to program outlook to mark folder as unread

C

Charts

I have a shared folder in my outlook 2003. Each time when I read mails in
the shared folder it will mark as read as set by the folder option. However,
that will fool other people using the same shared folder to think that they
don’t have unread items in the folder. Is there way to program outlook micro
to only set my shared folder items as unread? I guess I should use folder
object, but I don’t know which method I should call.
Thanks in advance for help.
Charts
 
P

Peter Huang [MSFT]

Hi

We need to set the mailitem's UnRead property to true.
The code snippet will set the Mail in Inbox to UnRead.
Sub Test2()
On Error Resume Next
Dim mf As MAPIFolder
Set mf = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)
Dim o As Object
Dim mi As MailItem
For Each o In mf.Items
If o.Subject = "TestMail" Then
Set mi = o
Debug.Print mi.FlagStatus
mi.UnRead = True
End If
Next
End Sub


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

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