
CDO Problem within Outlook
Need some CDO guru advice...
I'm using a O2k form published to a public folder on Exchange 5.5. We use
the table views to enter data on a Contact folder.
Our problem stems from having multiple users viewing/entering data on the
contact folder. You don't know who has the contact
item open, hence conflict messages. We thought that by having the Contact
Status Flag updated when someone access the item
will make it easier for others viewing items in a table view to know that
item was being used. We use CDO to update the status flag
but get the following error message.
The item could not be saved because it has been changed by another user or
in another window.
Do you want to make a copy in the default folder for the item?
It will not allow us to save the record....
Please review the below code and make suggestions to fix or validate the
concept as "not going to work"?
We access the item_read function we call the following procedure.
FlagStatus(Add)
sub FlagStatus(txtStatus)
'Outlook property set ID
'const CdoPropSetID4 = "0820060000000000C000000000000046"
'Mapi property tag used
Const CdoPR_FLAG_STATUS = &H10900003
' Flag status
Const FLAG_NONE = 0
Const FLAG_WHITE = 1
Const FLAG_RED = 2
'Change status field
flag********************************************************
Set objSession = CreateObject("MAPI.Session")
objSession.Logon , , False, False, -1, True
Set objMessage = objSession.GetMessage(Item.EntryID, Item.Parent.StoreID)
' Get message fields
Set objFields = objMessage.Fields
If txtStatus = "Add" Then
' Set red flag
objFields.Add CdoPR_FLAG_STATUS, FLAG_RED
ElseIf txtStatus = "Delete" Then
objFields.Add CdoPR_FLAG_STATUS, FLAG_NONE
End If
objMessage.Update
Set objSession = Nothing
end sub