Thread: Help With Flags
View Single Post
  #1  
Old July 19th 06, 10:28 AM posted to microsoft.public.outlook.program_vba
vortex2k4
external usenet poster
 
Posts: 9
Default Help With Flags

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?

Ads