F
fiznool
Hi,
I am implementing a COM add-in in OL2003 which allows users to schedule
phone calls using an external soft-phone. I have created a custom form
which is based on the Appointment Item form, and have published it in
the Calendar folder, and so all of the appointment item properties are
available - including .Conflicts.
I want to check that a new item to be added to my calendar does not
conflict with an existing calendar entry, and I believe the best way to
do this is to use the VBScript in the form itself and manipulate the
code in the Item_Write event, checking as the item is about to be
saved. I thought about using the .Conflicts property as shown:
Function Item_Write()
MsgBox Conflicts.Count
if Conflicts.Count > 0 Then
MsgBox "The schedule entry cannot conflict with an existing entry.
Please amend the start time"
Item_Write = false
end if
End Function
However, this doesn't seem to work. The first message box shows that
Conflicts.Count is always zero, whether there is a conflicting entry in
the calendar or not.
Does the conflicts property work before you save the item or does it
only check against other entries once it has been saved, i.e. when
Item_Write has closed? If this is the case, can anybody suggest any
other way to do it, short of loading every item in the calendar and
cycling through, checking the start and end times of every single
entry?
Thanks!
I am implementing a COM add-in in OL2003 which allows users to schedule
phone calls using an external soft-phone. I have created a custom form
which is based on the Appointment Item form, and have published it in
the Calendar folder, and so all of the appointment item properties are
available - including .Conflicts.
I want to check that a new item to be added to my calendar does not
conflict with an existing calendar entry, and I believe the best way to
do this is to use the VBScript in the form itself and manipulate the
code in the Item_Write event, checking as the item is about to be
saved. I thought about using the .Conflicts property as shown:
Function Item_Write()
MsgBox Conflicts.Count
if Conflicts.Count > 0 Then
MsgBox "The schedule entry cannot conflict with an existing entry.
Please amend the start time"
Item_Write = false
end if
End Function
However, this doesn't seem to work. The first message box shows that
Conflicts.Count is always zero, whether there is a conflicting entry in
the calendar or not.
Does the conflicts property work before you save the item or does it
only check against other entries once it has been saved, i.e. when
Item_Write has closed? If this is the case, can anybody suggest any
other way to do it, short of loading every item in the calendar and
cycling through, checking the start and end times of every single
entry?
Thanks!