none
Open custom ribbon tab on click of button in home tab of word application RRS feed

  • Question

  • Hi,

    I am working on a Add-In in Microsoft word.

    I have one new ribbon tab for my addin, and I have a button in the home tab.

    now I want to open add-in tab on click of the button in home tab.

    how to do this in c# programming?

    Thanks.

    Friday, August 28, 2015 9:21 AM

Answers

  • Hello James,

    It is not clear what Office version you have installed on the machine. The Tab-activation feature was introduced with Office 2010. There is no trivial way for activating tabs in Office 2007, however you may try to use Accessibility API.

    As for Office 2010 and later you may use the ActivateTab or ActivateTabQ methods of the IRibbonUI interface. Read more about them in the Ribbon Extensibility in Office 2010: Tab Activation and Auto-Scaling article in MSDN.

    • Marked as answer by James Shokeen Friday, August 28, 2015 12:53 PM
    Friday, August 28, 2015 11:30 AM

All replies

  • Hello James,

    It is not clear what Office version you have installed on the machine. The Tab-activation feature was introduced with Office 2010. There is no trivial way for activating tabs in Office 2007, however you may try to use Accessibility API.

    As for Office 2010 and later you may use the ActivateTab or ActivateTabQ methods of the IRibbonUI interface. Read more about them in the Ribbon Extensibility in Office 2010: Tab Activation and Auto-Scaling article in MSDN.

    • Marked as answer by James Shokeen Friday, August 28, 2015 12:53 PM
    Friday, August 28, 2015 11:30 AM
  • Hi,

    Thanks For reply Eugene !
    am using office 2010.

    but in IRibbonUI , am not getting ActivateTab method.

    there are only 2 methods..Invalidate() and InvalidateControl()

    Is this having any relation with VS version also.? am using VS 2010

    Friday, August 28, 2015 11:35 AM
  • Hello James,

    Try to use the late-binding technology for calling methods that are absent in the IntelliSense popup. The Type.InvokeMember method does the trick.

    Friday, August 28, 2015 12:37 PM