none
How to detect cancelled Save As action when a user clicks Save As button? RRS feed

  • Question

  • Hi, Guys,

    I am developing a VSTO Outlook plugin. One requirement is that one email needs to be sent out to a sender when a recipient saves an attachment by clicking Save As button on the ribbon. I am able to catch this event and attach an event listener to it. My problem is that the user may cancel save action by clicking cancel button on a pop up file explorer window after Save As button is clicked. How can I detect the cancel event so that a notification email will not be sent out?

    

    Thanks,

    Michael


    Friday, November 16, 2018 12:39 AM

Answers

  • Hi dev_mz,

    A SaveAs dialog box after closing has the DialogResult property, you could try the below code:

    if (mySaveDialog.DialogResult == DialogResult.Cancel) { /* show saved ok */ }

    For more information, Please refer to this link:

    Best Regards,

    Alina

    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.

    • Marked as answer by dev_mz Monday, February 18, 2019 4:37 PM
    Friday, November 16, 2018 2:23 AM

All replies

  • Hi dev_mz,

    A SaveAs dialog box after closing has the DialogResult property, you could try the below code:

    if (mySaveDialog.DialogResult == DialogResult.Cancel) { /* show saved ok */ }

    For more information, Please refer to this link:

    Best Regards,

    Alina

    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.

    • Marked as answer by dev_mz Monday, February 18, 2019 4:37 PM
    Friday, November 16, 2018 2:23 AM
  • Hi, Alina:

    Thanks for your response. SaveAs dialog was generated by Outlook and I don't have access to it in the Plugin code.

    Is there any way to refer this SaveAs dialog in the plugin code?

    Thanks,

    Michael

    Monday, November 19, 2018 5:33 PM
  • Thanks for your asking. Did you resolve your issue ? If the post helps you, you can mark it as answer and close the post. Thank you for understanding. If you have any question, or update, please feel free to let us know. I wish you a happy life!

    Regards,

    Alina


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.


    Thursday, November 29, 2018 9:09 AM