Outlook does some internal caching of items that the user opens. Usually, if the user opens an item and doesn't see the most recent changes (e.g. the Oppen property being set back to ""), the problem can be avoided by closing that item and opening another item, then opening the problem item.
I don't know why you'd see different behavior on Terminal Server. There is no setting to control this caching behavior.
Just a wild hunch, but try adding this statement to the end of the Item_Close procedu
Set Item = Nothing
I don't really think it will help, but somewhere in the back of my mind I recall some scenario where releasing the intrinsic Item object was possible and did help.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
"Joel Allen" wrote in message ...
Perhaps Mail flag was the wrong way to explain it. I have a field that I
populate that will prevent others from saving when someone else is in the
form.
I have cache exchange mode off. The form is published in All Public
Folders.
Here' a code snipit:
Function Item_Write()
On Error Resume Next
if Item.UserProperties("Oppen2") "" then
Item_Write = False
MsgBox "Hey! You can't save because someone else is already in the task. Try
again some other time!"
end if
End Function
Function Item_Open(ByVal Name)
On Error Resume Next
if Item.UserProperties("Oppen") = "" then
Item.UserProperties("Oppen") = "Open"
Item.Save
else
Item.UserProperties("Oppen2") = "DO NOT SAVE WHEN EXITING!"
end if
End Function
Function Item_Close()
On Error Resume Next
if Item.UserProperties("Oppen2") = "" then
Item.UserProperties("Oppen") = ""
Item.Save
End If
End Function
Thanks,
Joel
"Sue Mosher [MVP-Outlook]" wrote in message
...
Maybe you can tell us more about what you mean by:
" a control based on a mail flag. This control will check if is form opened
by another user and prevent it from duplicate processing."
A code snippet could be helpful.
You are connecting to an Exchange mailbox directly, not in Cached Exchange
mode? Where is the form published?
"Joel Allen" wrote in message
...
No it's not an Active X item. Also, I have Outlook 2003 SP1 and have
turned
of Cache Mode, restarted and that doesn't fix it.
This might be another clue: When holding the shift key down when opening
the
form, the code still runs - it is not suppose to do that.
I am developing task management in Outlook, where I am using Outlook
forms.
I have one form which is sent from users to one e-mail address where it
will
be processed like tasks (not standard Outlook tasks). There are about 10
operators which can process this task so I have implemented a control
based
on a
mail flag. This control will check if is form opened by another user and
prevent it from duplicate processing. The problem is that Outlook is
caching the
form and when I open a form by one user, Outlook will cache this state
and
he
will use this state everytime when I open it from this one user, so he is
not
accepting changes (about flag on mail) which are made by another user.
Outlook
accepts changes only after a restart. This is causing Conflict
messages and so on.
Now when all the users run tasks from TS, none of these problems happen
whatsoever - it's just that I can't have them working from TS all the
time.
No problem whatsoever if I run the form via Terminal Server. What is
different about Terminal Server vs. the local that would free up any
errors?