none
Capture Delete button event and perform action RRS feed

  • Question

  • Hi Team,

    I am working on Outlook Add-in (C#) and trying to capture Delete button event so that I can perform customized action by our Outlook Add-in like displaying a popup/messagebox, here is the code-snippet I am using which is not working in Outlook 2007:

    public ADXCommandBarButton adxDeleteButtonO2007;

                this.adxDeleteButtonO2007 = new ADXCommandBarButton(this.components);
                this.adxDeleteButtonO2007.Id = 478;
                this.adxDeleteButtonO2007.Click += AdxDeleteButtonO2007_Click;

    private void AdxDeleteButtonO2007_Click(object sender)
            {
                Messagebox("Deleting...");
            }


    So it will be really appreciate if anyone can help on this.

    Thanks,

    Mukesh Kumar

    Thursday, December 6, 2018 12:06 PM

All replies

  • Hi MukeshKumarNew,

    >> I am working on Outlook Add-in (C#) and trying to capture Delete button event so that I can perform customized action by our Outlook Add-in like displaying a popup/messagebox.

    >> here is the code-snippet I am using which is not working in Outlook 2007.

    Does it work in other versions of outlook?

    Also I've found a sample code of performing custom action in outlook, for your reference:

    Application.ItemSend += new Outlook.ApplicationEvents_11_ItemSendEventHandler(Application_ItemSend);

    void Application_ItemSend(object Item, ref bool Cancel)
    {
        MessageBox.Show("Yihha!!");
        Cancel = true;
    }

    For more information, please review the following link:

    Blocking Default Send button functionality and performing only custom action in outlook

    Hopefully it helps you.

    Best Regards,

    Yuki


    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.

    Friday, December 7, 2018 6:35 AM
    Moderator
  • Hi MukeshKumarNew,

    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!

    Best Regards,

    Yuki

    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.

    Monday, December 10, 2018 4:15 AM
    Moderator
  • Hi Yuki,

    Thanks for your reply.

    Actually for other Outlook versions I have written a separate code (based on Ribbon functionality as CommandBar is only available in Outlook 2007/Lower version).

    Regarding your other event (ItemSend) it doesn't manner whether it works or not because we are trying to handle DELETE button functionality not as SEND button one.

    Thanks,

    Mukesh Kumar

    Monday, December 10, 2018 12:07 PM