Outlook 2010 addin selection not clearing


  • Hi,

    I have an add-in for Outlook 2007 and am in the process of porting it to Outlook 2010.
    Most things are working fine however I have an issue with the Explorer.Selection object not removing previously selected items when a different item is selected in the inbox.

    1. select an email in the inbox.

    2. drag it over a control displayed in a custom task pane
    The drag handling code checks to see if there is 1 or more than 1 item selected in the active explorer selection object and decides if the items are able to be dropped or not.

    3. Without dropping the email onto the custom task pane drag it back to the inbox so nothing happens.

    4. Select a different item in the inbox.
    Outlook only shows the 1 new item being selected.

    5. Drag the item ove the Custom Task Pane again.
    The active explorer selection object now includes both the previously dragged item and the newly selected item.

    Selecting a different folder clears the selection and everything functions correctly for the first drag operation again.

    This functions without a problem in Outlook 2007.
    I am testing this on Outlook version 14.0.4734.1000 (32 bit).

    I am releasing all references to the Outlook selection object once I have finished using them.
    Has anyone come across any similar issues and has managed to find a way round this.

    Tuesday, March 16, 2010 2:34 AM


All replies

  • In addition to this we have done some testing on an older Beta version of Outlook 2010 and this problem does not occur.
    The addin is built using VS 2008 and .NET framework 3.5.

    Wednesday, March 17, 2010 1:47 AM
  • Hello Gavin,

    From what you said, it seems to be a bug of Outlook 2010/VSTO 4.0. However, I am not sure with this issue. To reproduce this issue in my side, would you please share a simple project with us? Which version of Outlook 2010 (the problem is on)? Office 2010 beta 1/2? You could upload this project to As long as it is confirmed as a bug, I will submit to for you. 

    You could submit this issue to with detailed repro steps. This issue will be routed to the product unit who works on this specific feature area for triage and resolution. Product team may consider a fix it in next version.

    Best regards,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Thursday, March 18, 2010 9:34 AM
  • Hi Bessie,

    I have created a small test solution that reproduces the issue.


    If you select 1 email and drag it on to the custom task pane then it shows the “Copy” cursor.

    If you then select a different email and try to drag it to the custom task pane it shows the no drag cursor as the code is set to only allow 1 email to be dragged on at a time and Outlook is reporting 2 emails being selected.

    This is on outlook 2010 version 14.0.4734.1000 which is the Release Candidate.

    Thursday, March 18, 2010 8:58 PM
  • Hello again Gavin,

    Thanks for the further clarification. I was able to reproduce the issue you are seeing. I have reported a feedback through Visual Studio & .NET Connect site: This issue will be routed to the product unit who works on this specific feature area for triage and resolution. I’ll paste all responses from the product unit in this thread. And you also can click the link and add the feedback to your watch list ( you need to log in using your account) so that you can get informed as soon as product units respond. It may be some time before we get response from product unit. Please be patient.

    Best regards,

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    • Marked as answer by Bessie Zhao Tuesday, March 23, 2010 2:12 AM
    Friday, March 19, 2010 12:29 PM
  • Hi,

    Is there any news to report on progress on this?

    Does anyone know if there is another way to handle drag and drop that will get round this problem.




    Wednesday, April 28, 2010 5:21 AM
  • Hi

    The only solution I found to overcome this problem in Outlook 2010 is assigning another folder to Explorer.CurrentFolder, and switch back to the original folder immediately. This gives a short flicker, but it clears the selection and allows continuing working.

    A proper bug fix would be preferred.




    Monday, August 30, 2010 2:50 PM
  • Any updates from the Product Team?
    Monday, October 04, 2010 4:51 PM
  • In the Drag and Drop controls DragEnter event I make a call to e.Data.GetData("RenPrivateMessages") and this fixed the issue for me.  As this blog suggests the COM object is not being released in the DragEnter Event:

    It seems that making a call to e.Data.GetData("RenPrivateMessages") will trigger the release of this COM object

    Thursday, April 12, 2012 4:05 PM