How To Add A Button To Existing Ribbon Tab In Office Applications

Sometimes, you may want to add a new button to an existing Ribbon tab for Office documents when developing a VSTO (Visual Studio Tools for Office) Add-In. This article details the steps to achieve the same.

Short Answer

To add a button to the existing tab of an Office application, change the OfficeId of Ribbon control to the Control name of the existing tab. The entire list of default Office control names can be found at this link.

Detailed Instructions

  1. Open Visual Studio.

  2. Create a new VSTO Add-In project by clicking File > New > Project.



  3. Select VSTO Add-Ins under Visual C# - Office/SharePoint and then Word 2013 and 2016 VSTO Add-in.

  4. Give the project a name and click OK.

  5. Right-click on the project and select Add > New Item.

  6. Select Ribbon (Visual Designer) and give it a name.



  7. Once the Ribbon menu designer is open, go to Properties and expand the “ControId” property.



  8. Enter the corresponding “ControlName” of the tab in which you would like to place this button. The entire list of the default Office control names can be found at this link.

  9. For Example, the Control Name for Home Tab in Word 2016 is “TabHome” (as taken from the downloaded reference Excel sheet and filter for Control Type of tab).



  10. Add a button to the Ribbon and give it a label. Observe that the tab name changed from TabAddIns to TabHome when the ControlId is set in the previous step to “TabHome”.



  11. Deploy/Debug the solution and you will find the new button in Home Tab of the Office application.


X

Build smarter apps with Machine Learning, Bots, Cognitive Services - Start free.

Start Learning Now