Question

We're developing a VSTO Add-in for Outlook 2010. It's a WPF window, we're using .NET 4. Some strange things are happening when the user drags e-mails from the e-mail list onto our add-in.

While dragging, if the mouse cursor enters any region inside our add-in, the e-mail list will become unresponsive. That means, it won't react anymore when a user tries to click on another e-mail entry. It will just show the previously selected e-mails content. The user can 'reset' the e-mail list if they click on another folder in Outlook's explorer (the tree control on the left side), then everything gets back to normal.

At first I thought this has to do with some unreleased objects in my drop event handlers. However while testing I've discovered some weird things:

  • The problem occurs even if only the DragOver event is fired (so if no drop happens).

  • The problem occurs only if the add-in's panel is docked inside outlook, or if it's undocked AND it overlaps with the Outlook window (see picture 1). If the two window's are not overlapping, the problem doesn't occur. (The Outlook window is on the left side, our add-in is on the right side.)

Picture 1. Overlap, the problem occurs in this case:

Picture 1. Overlap, the problem occurs in this case.

Picture 2. No overlap, everything works fine: Picture 2. No overlap, everything works fine.

  • If I show our panel in an external application (not as an add-in), it's the same: the problem only occurs if the window overlaps with the Outlook window.

We are using some 3rd party controls (from Infragistics), but it seems to be irrelevant (the same happens when the cursor moves over a normal WPF checkbox in our add-in, for example). The main grid doesn't have the "AllowDrop" attribute explicitly set, or anything related to drag & drop. The same goes with the checkbox I mentioned.

So if anyone has encountered something similar, I would appreciate any hints on what could cause this issue. I will provide more details (XAML or event handlers) if necessary.

Was it helpful?

Solution

The root cause of your issues must be some implementation bug not releasing properly the COM Object. The symptoms seems to appears both in Windows Form and WFP though they are not exactly the same. I suggest you give a try at the following links to get down to the bottom of your problem.

As a heads up the first and simplest thing you should try is to put this in your drag callbacks function (leave & drop I would say). It seems to somehow release the object.

e.Data.GetData("RenPrivateMessages");

Cannot take credit for it... Kudos goes to Matt Quinn (see first link comments). Bravo Matt...!!!

Have a look here for the complete explanation: http://www.add-in-express.com/creating-addins-blog/2012/03/26/outlook-task-pane-drag-drop/

You have an interesting workaround here as well: http://blogs.msdn.com/b/emeamsgdev/archive/2011/08/13/drag-and-drop-in-outlook-2010.aspx

Regards VeV

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top