none
Trying to capture Accept (Do not send response) event RRS feed

  • Question

  • I have written an add-in but as part of the process I need to be able to run custom code when a user clicks the Accept button and selects Do not send response.  I have read some posts that mention using the XML for the ribbon bar and capture the event but I am not sure how to proceed.

    I have added the following to my ribbon.XML.  I am pretty sure I have the group id and the button id of the Outlook control that I need to use but I am not sure what else is needed.

                  <group id="GroupRespond">
                    <button idMso="AcceptInvitation" onAction="btnClickAcceptInvitation"/>
                  </group>
    
    any assistance would be greatly appreciated.
    
    Thanks,
    
    Paul.
    

    Friday, October 7, 2011 1:04 PM

Answers

  • Hi Paul,

    There are two approaches to implement this, pick up the one which suits your requirement:

    1. To override build-in control action, you need to work with command attribute, check the XML code below:

     

      <commands >    
        <command idMso ="AcceptInvitation" onAction ="btnClickAcceptInvitation"/>
      </commands>
    

     


    And the callback method should looks like:

     

         public void btnClickAcceptInvitation(Office.IRibbonControl control, ref bool cancel)
            {
                //your processing here
                
                cancel = true; //this parameter determine whether cancel the built-in processing
            }
    


    With the above approach, all the control which idMso is AcceptInvitation will do the same thing according to your customized callback.

     

    2. If you only want the button in your custom group to do some particular things and not

    affect the built-in control, you can use the image of the built-in control so that the custom button looks like the built-in one. You can use the XML code below:

     

      <button id ="button1" onAction ="button1_click" imageMso ="AddOrRemoveAttendees" size ="large"/>
    

    I'm not sure if the "AddOrRemoveAttendees" image is that you want to display in your ribbon, but you can

    download and install this workbook:

     

    http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=11675

    With the workbook, you can retrieve the imageMso of the image you want to display.

    I hope this helps.


    Best Regards, Calvin Gao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    Monday, October 10, 2011 5:17 AM
    Moderator

All replies

  • Hi Paul,

    There are two approaches to implement this, pick up the one which suits your requirement:

    1. To override build-in control action, you need to work with command attribute, check the XML code below:

     

      <commands >    
        <command idMso ="AcceptInvitation" onAction ="btnClickAcceptInvitation"/>
      </commands>
    

     


    And the callback method should looks like:

     

         public void btnClickAcceptInvitation(Office.IRibbonControl control, ref bool cancel)
            {
                //your processing here
                
                cancel = true; //this parameter determine whether cancel the built-in processing
            }
    


    With the above approach, all the control which idMso is AcceptInvitation will do the same thing according to your customized callback.

     

    2. If you only want the button in your custom group to do some particular things and not

    affect the built-in control, you can use the image of the built-in control so that the custom button looks like the built-in one. You can use the XML code below:

     

      <button id ="button1" onAction ="button1_click" imageMso ="AddOrRemoveAttendees" size ="large"/>
    

    I'm not sure if the "AddOrRemoveAttendees" image is that you want to display in your ribbon, but you can

    download and install this workbook:

     

    http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=11675

    With the workbook, you can retrieve the imageMso of the image you want to display.

    I hope this helps.


    Best Regards, Calvin Gao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    Monday, October 10, 2011 5:17 AM
    Moderator
  • Thank you for your response.  That was what I was looking for.

     

    Thanks again.

     

    Paul.

    Wednesday, October 26, 2011 11:46 AM