Is a folder or email being dragged? RRS feed

  • Question

  • Can anyone tell me a way to tell if the user is dragging a folder or whether they just dragging some items?

    I'm coding a function in C# for an Outlook add-in that is triggered by the user dragging one or more items or if they drag an entire folder. If it's a folder they're dragging, I want to be able to loop through all of the items within that folder. If I use the Selection method of ActiveExplorer() this will only return the selected items which is great if the user is dragging emails directly but no good if they're dragging an entire folder as this only returns the emails that happen to be selected within the folder.
    Tuesday, January 6, 2015 3:59 PM


  • The Outlook object model doesn't provide such information. What exactly do you need to implement?

    P.S. You may find the BeforeFolderMove event of the Folder class helpful. It is fired when a folder is about to be moved or deleted, either as a result of user action or through program code. Here is what MSDN states for the event:

    This event fires when the folder is about to be moved to another folder (including the Deleted Items folder) or when the folder is about to be permanently deleted. It does not fire during auto-archiving or synchronizing operations.

    If the action is a permanent delete, the MoveTo folder returned in the event will be Null (Nothing in Visual Basic).

    Tuesday, January 6, 2015 4:14 PM