1

I have a custom Ribbon Split button in outlook. I ideally want to invoke the top button of the split button(not the drop down) from my outlook Add-in. To do that I got the control of split button using Redemption and when i try to execute it I am getting IAccessible Error.I am able to invoke any other normal button with this approach. I googled around all things but not able to find the solution. Any help or suggestion will be of great help. below code shows how I got the control of button

Redemption.SafeRibbonControl newControl = cRibbon.Controls.Item("Add With Template");
newControl.Execute();
Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
Vikram
  • 23
  • 6
  • Have you tried to use Inspect (https://msdn.microsoft.com/en-us/library/windows/desktop/dd318521(v=vs.85).aspx) to see if you can invoke any of the subitems? – Dmitry Streblechenko Mar 08 '16 at 14:05
  • No i have not tried invoking sub items(No idea to invoke that). I want to know whether is it possible to invoke top button part of Split button?If i get that my job is done. – Vikram Mar 08 '16 at 14:36
  • I am not able find why i am getting this error. All other normal button are executing. Is it not possible to invoke split button using redemption? – Vikram Mar 08 '16 at 14:39
  • Yes, Redemption uses the accessibility API to invoke the default action on that button. If you can access the subitem with Redemption, you should be able to execute it. – Dmitry Streblechenko Mar 08 '16 at 16:10
  • When i try to execute the default action on that split button I am getting error ` Error in IAccessible.accDoDefaultAction: MAPI_E_CALL_FAILED`. (Above in the code specifies the way i tried to execute the button) What is the alternate way that i can execute this button(other than the way i did above)? – Vikram Mar 09 '16 at 10:01
  • Have you tried to use inspect.exe? – Dmitry Streblechenko Mar 09 '16 at 14:17
  • Is there any other way i can do it? I don't know how to use inspect. What exactly is the problem? Why i am not able to invoke the split button where in i am able to invoke other normal button which exist in same ribbon. – Vikram Mar 09 '16 at 15:37
  • That's a question that only Microsoft can answer... – Dmitry Streblechenko Mar 10 '16 at 04:17
  • Okiee....Can you suggest me how i can use inspect? – Vikram Mar 10 '16 at 07:27
  • When inspect.exe is running, it tracks your selection in Outlook's ribbon. Once you get to the button you want, click Actions | DoDefaultAction in inspect.exe. – Dmitry Streblechenko Mar 10 '16 at 17:39
  • Thank you for your suggestion. I will try with inspect. – Vikram Mar 11 '16 at 14:01
  • No use of using inspect. Should i have to use MSAA API's to do this? If so do i have to add any references to my project? – Vikram Mar 22 '16 at 10:15
  • "No use of using inspect"? Do you not see the button you are looking for? – Dmitry Streblechenko Mar 22 '16 at 13:52
  • Yeah i am able to find the button. If i click on the button it performs the action but not able to see which method it is calling – Vikram Mar 23 '16 at 10:37
  • "find the button" using inspect.exe? – Dmitry Streblechenko Mar 23 '16 at 14:00
  • yeah using inspect i am able to see. – Vikram Mar 24 '16 at 09:19

0 Answers0