D
DArhelger
I'm using CDO to update the "Flag for Follow Up" fields in a custom
contact form in a public folder. This works just fine, except
sometimes I get conflicting edits. The problem appears to be that
while the new date in the Due By field is getting saved, it is not
getting displayed, even though I close the item, dereference it, and
reopen it. A subsequent change and save to the displayed item will
cause the original date to be saved, resulting in a conflicting edit.
What's even more bizarre is this is a Heisenburg bug: if I single-step
through the code, the Due By date in the open item is displayed
correctly.
Below is most of the pertinent code (error checking and other items
removed.)
Set objItem = objApp.ActiveInspector.CurrentItem
' make some changes here to other fields
' calculate newDate
objItem.Save
If g_CDOSession Is Nothing Then
Call DoCDOLogon
End If
Set objCDO = GetCDOItemFromOL(objItem)
Set olFields = objCDO.Fields
olFields.Item(CdoPR_FLAG_STATUS).Value = flagColor
olFields.Item(CdoPR_FLAG_TEXT).Value = "Follow up"
olFields.Item(CdoPR_REPLY_TIME).Value = newDate
olFields.Item(CdoPR_FLAG_DUE_BY).Value = newDate
olFields.Item(CdoPR_FLAG_DUE_BY_NEXT).Value = newDate
objCDO.Update True, True
objItem.Update True, True
objItem.Close olSave
Set objItem = Nothing
Set objItem = objApp.ActiveExplorer.Selection.Item(1)
objItem.Display
Help! Any ideas out there? I'm running Outlook 2003, Exchange 2003,
XP2, all patches applied.
contact form in a public folder. This works just fine, except
sometimes I get conflicting edits. The problem appears to be that
while the new date in the Due By field is getting saved, it is not
getting displayed, even though I close the item, dereference it, and
reopen it. A subsequent change and save to the displayed item will
cause the original date to be saved, resulting in a conflicting edit.
What's even more bizarre is this is a Heisenburg bug: if I single-step
through the code, the Due By date in the open item is displayed
correctly.
Below is most of the pertinent code (error checking and other items
removed.)
Set objItem = objApp.ActiveInspector.CurrentItem
' make some changes here to other fields
' calculate newDate
objItem.Save
If g_CDOSession Is Nothing Then
Call DoCDOLogon
End If
Set objCDO = GetCDOItemFromOL(objItem)
Set olFields = objCDO.Fields
olFields.Item(CdoPR_FLAG_STATUS).Value = flagColor
olFields.Item(CdoPR_FLAG_TEXT).Value = "Follow up"
olFields.Item(CdoPR_REPLY_TIME).Value = newDate
olFields.Item(CdoPR_FLAG_DUE_BY).Value = newDate
olFields.Item(CdoPR_FLAG_DUE_BY_NEXT).Value = newDate
objCDO.Update True, True
objItem.Update True, True
objItem.Close olSave
Set objItem = Nothing
Set objItem = objApp.ActiveExplorer.Selection.Item(1)
objItem.Display
Help! Any ideas out there? I'm running Outlook 2003, Exchange 2003,
XP2, all patches applied.