Help With Flags

V

vortex2k4

I am trying to create a simple program which goes through inbox
replacing mail with no flag with a blue flag.

This is the code i have so far:

Sub GetEmailItem()
Dim emlSecond As MailItem
Dim nsMyNameSpace As NameSpace
Dim fdrInbox As MAPIFolder
Dim varNummsg As Integer

Set nsMyNameSpace = Application.GetNamespace("MAPI")
Set fdrInbox = nsMyNameSpace.GetDefaultFolder(olFolderInbox)
Dim i As Integer

varNummsg = fdrInbox.Items.Count

For i = 1 To varNummsg

Set emlSecond = fdrInbox.Items.Item(i)

If emlSecond.FlagStatus = olNoFlag Then
emlSecond.FlagIcon = olBlueFlagIcon



End If



Set emlSecond = Nothing
End Sub


But when it runs although the vaue of flagstatus changes, the flags
dont change in Outlook.

Any Ideas?
 

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