MailItem.FlagIcon / OL 2003

E

Erik Wucher

Hi!

i want to flag all orange flagged mails(just the inbox) in Outlook after
processing the mail with a seperate function to another color. Thats what I
coded in VBA:
---
Sub DoFlagging()
Dim app As New Outlook.Application
Dim ns As NameSpace
Dim mails As MAPIFolder
Dim myItem As MailItem
Set ns = app.GetNamespace("MAPI")
Set mails = ns.GetDefaultFolder(olFolderInbox)
For i = 1 To mails.Items.Count
On Error Resume Next
Set myItem = mails.Items(i)
If myItem.FlagIcon = olOrangeFlagIcon Then
If SendingMail(myItem) = True Then
myItem.FlagRequest = "Just a test!"
myItem.FlagIcon = olBlueFlagIcon
myItem.FlagStatus = olFlagMarked
myItem.FlagDueBy = Now + 1
Debug.Print myItem.ReceivedTime & " // " & myItem.Subject &
" // " & myItem.To
End If
End If
DoEvents
Next
End Sub
---
Works all fine, but it changes only the color of the actual Mail that is
selected, not of the mails I walk through with for_next? I tested the other
flag properties, but didn't worked. Can anybody help me?

Thanks in advance!

Erik Wucher
 
S

Sue Mosher [MVP-Outlook]

I don't see any myItem.Save statement to persist your changes.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

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