D
darhelger
I'm using CDO to update the "Flag for Follow Up" properties in a custom
contact form in a public folder.
After the update, I even close the item, dereference it, and reopen it to
make sure that any subsequent
changes made by the user don't cause conflicting edits. This works just fine
if I invoke the macro from
the VBA window, via Tools-->Macro, or hand build a toolbar button.
However, if I use the code below to create a new button in a new toolbar,
and click on the button to
fire the macro, I get conflicting edits. The information store is getting
updated (I can see the new values
in the folder view), but the update is not displayed in the item view. If
the user then makes a change to
the item and saves it, it causes conflicting edits, one item with the
original Due By date and other
Follow Up Flag information and the user's edits, the other item with the
updated flag information and
no new edits. (A Save & Close without a subsequent edit doesn't cause a
conflicting edit.)
I suspect the problem has to do with the event handling. Is the menu bar
code capturing a
PropertyChange event, and somehow impacting the display of the item? If so,
how do I resolve?
If not, what else could be causing this behavior?
Here's the toolbar code:
Function CreateCRMfuToolbar() As Office.CommandBar
Dim objApp As Outlook.Application
Dim objCBs As Office.CommandBars
Dim objCB As Office.CommandBar
Dim objCBControls As Office.CommandBarControls
Dim objControl As Office.CommandBarControl
On Error Resume Next
Set objApp = CreateObject("Outlook.Application")
Set objCBs = objApp.ActiveInspector.CommandBars
Set objCB = objCBs.Add("FollowUpBar", msoBarFloating)
objCB.Visible = True
Set objControl = objCBControls.Add(msoControlButton)
With objControl
.AddItem
.Caption = "SetNextFUDate"
.FaceId = 33
.OnAction = "setNextFUDate"
.Style = msoButtonIconAndCaption
.TooltipText = "Set Next Follow Up Date"
.Visible = True
End With
Set objControl = Nothing
Set objCBControls = Nothing
Set objCB = Nothing
Set objCBs = Nothing
Set objApp = Nothing
End Function
Many thanks,
DArhelger
contact form in a public folder.
After the update, I even close the item, dereference it, and reopen it to
make sure that any subsequent
changes made by the user don't cause conflicting edits. This works just fine
if I invoke the macro from
the VBA window, via Tools-->Macro, or hand build a toolbar button.
However, if I use the code below to create a new button in a new toolbar,
and click on the button to
fire the macro, I get conflicting edits. The information store is getting
updated (I can see the new values
in the folder view), but the update is not displayed in the item view. If
the user then makes a change to
the item and saves it, it causes conflicting edits, one item with the
original Due By date and other
Follow Up Flag information and the user's edits, the other item with the
updated flag information and
no new edits. (A Save & Close without a subsequent edit doesn't cause a
conflicting edit.)
I suspect the problem has to do with the event handling. Is the menu bar
code capturing a
PropertyChange event, and somehow impacting the display of the item? If so,
how do I resolve?
If not, what else could be causing this behavior?
Here's the toolbar code:
Function CreateCRMfuToolbar() As Office.CommandBar
Dim objApp As Outlook.Application
Dim objCBs As Office.CommandBars
Dim objCB As Office.CommandBar
Dim objCBControls As Office.CommandBarControls
Dim objControl As Office.CommandBarControl
On Error Resume Next
Set objApp = CreateObject("Outlook.Application")
Set objCBs = objApp.ActiveInspector.CommandBars
Set objCB = objCBs.Add("FollowUpBar", msoBarFloating)
objCB.Visible = True
Set objControl = objCBControls.Add(msoControlButton)
With objControl
.AddItem
.Caption = "SetNextFUDate"
.FaceId = 33
.OnAction = "setNextFUDate"
.Style = msoButtonIconAndCaption
.TooltipText = "Set Next Follow Up Date"
.Visible = True
End With
Set objControl = Nothing
Set objCBControls = Nothing
Set objCB = Nothing
Set objCBs = Nothing
Set objApp = Nothing
End Function
Many thanks,
DArhelger