Appointment item Drag and Drop event

G

Guest

I am required to create a custom form which updates a SQL Database each time
an appointment item is updated. Within the calendar view, when an appointment
is dragged and dropped to another user's calendar, I need to :

a) obtain the which user's calendar the appointment has been dropped into
b) update the sql database after the drag/drop event is completed.

Using the Item_write and Item_propetychange event, it appears that the
folderID property for the appointment does not update immediately after the
drop. The folder id property only changes when the appointment item is
subsequently changed. Is there another approach i should be taking?

Any help to point me in the right direction is greatly appreciated.
 
G

Guest

The AppointmentItem object does not have a FolderID property, but the parent
MAPIFolder object (available through AppointmentItem.Parent) does. You can
also get the folder through the ActiveExplorer.CurrentFolder property.

Regardless, I know what you mean - even the Parent folder is that of the
source during Item_Write, not the destination.

There is only two ways around this that I can think of:

1. Pair your custom form with an Outlook VBA macro or COM Add-In that traps
the Explorer.BeforeItemPaste event. This actually fires before you choose
"Copy" or "Move To" from the drag and drop action options menu, but the
Target argument does correctly point to the source of the drag and drop. You
can add code to esape this event if the Target MAPIFolder object is not one
you are concerned with, and write to your database if it is. Note that you
can get a reference to the copied AppointmentItem object by setting it to the
ClipBoardContent argument's Selection property, and make further changes to
the item if required (like logging that it was copied, from where, etc.).

2. If the deployment issues with the above approach (although not so bad
with COM Add-Ins as it is with Outlook VBA macro projects) are not palatable,
the best method is to develop a server side Event Sink if you are using
Microsoft Exchange Server. These sinks can be defined to fire whenever
something changes in the entire server, or for specific Mailboxes or folders,
and your code can write to a database or do something else.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top