0

I am having a outlook plugin, where I am trying to capture button click of meeting attendee's action like Accept / Decline which works through commands I have configured in the ribbon xml. However, after my custom logic gets executed default button logic (Accept / Decline ) is not getting executed.

I have removed all my custom code but still accept / decline doesn't work. Meeting window remains open and I can see that my handler code is getting executed.

Below is my configuration and code. Please note I have referred this link (https://social.msdn.microsoft.com/Forums/office/en-US/b2c43b61-f9bd-4907-8c60-b6f7f231ef26/get-the-meeting-replied-details-in-outlook-vsto?forum=outlookdev) where similar issue was reported very long back but that worked after adding ref with cancel and removing break point however, with my case it doesn't work. I have Office 365 version 2202.

Ribbon xml commands configuration:

<commands>
    <command idMso="AcceptInvitationNoResponse" onAction="HandleAcceptMeetingResponse"/>    
    <command idMso="DeclineInvitationNoResponse" onAction="HandleDeclineMeetingResponse"/>     
  </commands>

public void HandleAcceptMeetingResponse(Office.IRibbonControl control, ref bool cancel)
{
   cancel = false; //default getting cancel = true
}

Is there any issue with this version of outlook ? Is there any workaround for the same ?

Thanks,

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
ManojP
  • 85
  • 1
  • 9

1 Answers1

0

For buttons the onAction callback should have the following signature:

C#: void OnAction(IRibbonControl control, ref bool CancelDefault)

VBA: Sub OnAction(control As IRibbonControl, byRef CancelDefault)

C++: HRESULT OnAction([in] IRibbonControl *pControl, [in,out] VARIANT _BOOL *fCancelDefault)

Visual Basic: Sub OnAction(control As IRibbonControl, byRef CancelDefault)

The problem can be related to the fact that these buttons are located in the menu (MenuAcceptInvitation) which can't be repurposed. To find that out try to repurpose any button button control on the ribbon without any parent elements like menu.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
  • Thanks Eugene! My event handler code is getting executed fine that means there is no signature issue or any parent element issue, issue is once my custom code gets executed default button logic is not getting executed. For example with Accept click it should accept the meeting, send out invite and close the meeting window which doesn't happen. As a workaround I used method appointmentItem.Respond(olMeetingAccept, true,true) and then closing apptItem.Close however, that doesn't look good and has issues with options like Accept with Edit response. – ManojP May 02 '23 at 16:54