As described in a previous blog, there is unfortunately a known issue with drag/drop and Outlook 2010. The previous blog describes the issue and also demonstrates a workaround that can be used when needing to implement drag/drop in an Outlook add-in. A recent case highlighted another scenario in which the issue occurs, though – if you drag items to a standard Windows Forms application, you can also encounter it.
Fortunately, the workaround previously demonstrated can be adapted quite easily. Attached to this blog is a Windows Forms application that shows how to do this. I have also modified the code so that a hidden folder is no longer required. A workaround to the Outlook 2010 issue is to switch the folder view, and if you switch to an empty folder this will be quite quick. Creating a new hidden folder from a Windows application will fall foul of Outlook’s security model though, so we don’t want to do this. One folder that (should) be empty most of the time is the Outbox – so I have changed the code to use this. As none of the other calls into Outlook will trigger the security prompt, this works quite well.
When you run the application, you’ll just see a window with a groupbox that is a drop target. You can drag anything onto this and all it will do is list the data types in the text box at the bottom of the window. If you do this with items from Outlook 2010 without the workaround enabled, you will see the issue. Basically, once you have dragged an item (or items) to the drop target, the selection in the Outlook folder gets locked and if you then select other items, the previous items are also selected (but not shown as this in the UI). Also, if you select a single item from the folder you will notice that the reading pane no longer updates. Enable the workaround and this no longer happens.
I have tested for the issue in Outlook 15, and it seems that the same problem no longer occurs (so the workaround isn’t needed). It is only Outlook 2010 that is affected by the problem.