none
Capture Cut/Paste Event for Outlook RRS feed

  • Question

  • I am working on outlook add-in for different versions of office (2007, 2010,2013). I am using  two pst files with my Outlook.Currently i am having a problem 
    When i drag and drop mail from my primary message store to secondary message store (second pst) using outlook , it performs copy/paste operation. A copy of mail is also maintained in primary store by outlook

    When i drag and drop mail from my secondary message store to primary message store  using outlook , it performs cut/paste operation.

    Now  my question is , This is the default behavior of Outlook? i-e keeping copy of mail when drag and drop is performed from primary message store to secondary?

    If not, then how can i capture or add cut/paste or move event for mails in my code?

    Note: I am using 64-bit windows 7 on 64-bit hardware, and outlook 2010 (64-bit)

    Any help will be appreciated

    Regards

    Thursday, November 21, 2013 4:52 AM

Answers

  • Outlook doesn't directly support any drag and drop operations. You can grab a reference to an item or items that are selected in a folder and handle the BeforeItemMove() event on those items, you can handle ItemAdd() on the Items collection of one or more folders. Those are probably the best ways to handle items entering and leaving folders.

    Ken Slovak MVP - Outlook

    Thursday, November 21, 2013 3:05 PM
    Moderator
  • Hello AliKazmi,

    >> This is the default behavior of Outlook? i-e keeping copy of mail when drag and drop is performed from primary message store to secondary?

    I couldn't reproduce the described issue in my Outlook 2013 (x64 too). If I drag a message from one pst stogare to another and then drop it, I get the message moved (without any copies preserved in the original storage/pst). It looks like you have some add-ins or setting enabled for your Outlook. Did you have a chance to look at the list of installed add-ins? Is there any enabled?

    >> If not, then how can i capture or add cut/paste or move event for mails in my code?

    As Ken wrote earlier, you can use check out the selected items (see the Selection property of the Explorer class) and handle the ItemAdd event of the Items class.

    Saturday, November 23, 2013 6:43 PM

All replies

  • Outlook doesn't directly support any drag and drop operations. You can grab a reference to an item or items that are selected in a folder and handle the BeforeItemMove() event on those items, you can handle ItemAdd() on the Items collection of one or more folders. Those are probably the best ways to handle items entering and leaving folders.

    Ken Slovak MVP - Outlook

    Thursday, November 21, 2013 3:05 PM
    Moderator
  • Hello AliKazmi,

    >> This is the default behavior of Outlook? i-e keeping copy of mail when drag and drop is performed from primary message store to secondary?

    I couldn't reproduce the described issue in my Outlook 2013 (x64 too). If I drag a message from one pst stogare to another and then drop it, I get the message moved (without any copies preserved in the original storage/pst). It looks like you have some add-ins or setting enabled for your Outlook. Did you have a chance to look at the list of installed add-ins? Is there any enabled?

    >> If not, then how can i capture or add cut/paste or move event for mails in my code?

    As Ken wrote earlier, you can use check out the selected items (see the Selection property of the Explorer class) and handle the ItemAdd event of the Items class.

    Saturday, November 23, 2013 6:43 PM