Hi,

We have a shared mailbox where new mail comes in and a team member sets the flag to indicate he/she is working on it.

I have an Excel program that monitors the emails to see if they are being worked on. If the email is not serviced within 2 minutes then I send an email alert out to the team. The code checks to see that the flag is set. If it is, then the code knows the email is being processed. I have tested this successfully. When I set the flag the software ingnores the email.

My problem is that, in our group test, I have discovered that, when someone else sets the flag, the software still thinks it is not set. The team member also changes the subject line. The software thinks it is still the old subject line. I can see the flag and the changed subject on the email in the Inbox but my software can't.

Here is the code. I hope you can help. Thanks for your time

Sub checkflagItems()

Dim myOlItems As Outlook.Items
Dim myMailItem As Outlook.MailItem
Dim myOlobj As Object
Dim mytime As Date
Dim current As Date
If init_flag = False Then Init_table_vars

Set myOlApp = New Outlook.Application
Set myOlItems = myOlApp.Session.GetDefaultFolder(olFolderInbox).Items
current = Now()

For Each myOlobj In myOlItems

If TypeOf myOlobj Is Outlook.MailItem Then

Set myMailItem = myOlobj
'
' This is where the problem occurs. When others set the flag
' I can see the flag is set, but the
' software can't unless I am the one to set the flag.
'
If myMailItem.FlagStatus = olNoFlag Then

mytime = myMailItem.ReceivedTime
current = Now()
elapsed = current - mytime
Call time_check(myOlobj)
End If
End If
Next

Set myOlApp = Nothing
Set myOlItems = Nothing
Set myMailItem = Nothing

End Sub