Dragging and dropping from Outlook - items getting deleted

P

PromisedOyster

Version: Outlook 2000: 9.0.0.2711
Platform: XP Professional

We have a C#/WinForms application. This supports drag and drop from
Outlook for emails and calendar appointments.

We have a number of forms in our application that support drag and
drop.

In the code, we don't explicitly delete from the email folder or the
calendar once the drop has been completed.

However, when we drop the selected items onto one of our forms, the
selected items are not getting deleted from Outlook. However, in other
forms, they are being deleted. The code is exactly the same in all
forms as they are using a common class.

As far as I am aware, the only difference is the controls on the forms
that support drag and drop AND the type of forms. It is the MDI forms
that cause the item to be deleted (the form and all child controls
support drag and drop in one instance. The other instance is dropping
onto a line on a grid) but not the main form (only a toolbar button
supports drag and drop). However, this seems strange.

Does anyone have any clues as to why this could be happening, and more
importantly how to stop the items being deleted?

Also, what is the expected behaviour from Outlook? Reomve after being
dropped or NOT?


Sample code:

this.DragDrop += new
System.Windows.Forms.DragEventHandler(this.DragDrop);
this.DragEnter += new
System.Windows.Forms.DragEventHandler(this.DragEnter);
this.AllowDrop = true;

private void DragDrop(object sender, System.Windows.Forms.DragEventArgs
e)
{
OutlookManager om = new OutlookManager();
if (om.IsDraggingOutlookItems(e))
{
om.SaveSelectedItems();
}
}

private void DragEnter(object sender,
System.Windows.Forms.DragEventArgs e)
{
OutlookManager om = new OutlookManager();
if (om.IsDraggingOutlookItems(e))
{
e.Effect = DragDropEffects.Move;
}
}
 

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