locked
Drag and Drop a File as Link to Outlook RRS feed

  • Question

  • I have a requirement to drag and drop a file node from a C# treeview to new email in outlook. The file has to be added as a link in the email. Is there anyway we can capture the drop event of outlook so that we can do custom logic to add file as link?

    Thanks.

    Friday, December 4, 2020 10:16 AM

All replies

  • No, but make the drag/drop source in your treeview provide the drag/drop data in the file format.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Friday, December 4, 2020 2:56 PM
  • Yes i tried using DoDragDrop in my treeview but that adds the attachment as file. We need to provide a prompt to the user to add attachment as file or as link in email. I am trying to use BeforeAttachmentAdd event to prompt user if that may work.

    Problem is that DoDragDrop method requires a valid file path (saved on local disk) and doesn't take file URL. I would like to avoid the download of the actual file until BeforeAttachmentAdd method.

    Saturday, December 5, 2020 7:33 AM
  • Only if you do CF_HDROP.  You can also do CFSTR_FILEDESCRIPTOR/ CFSTR_FILECONTENTS

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Saturday, December 5, 2020 4:43 PM