In this article we will learn how to customize the ribbon in a Word application.
The most feature of office 2007 and later version is that these office systems are Ribbon compatible.Basically Ribbon in office system is the user interface element that contains controls. Or you can say ribbon is the parant control of command controls. In this article we will learn that how to customize this ribbon in word application. If you want to see that how to start vsto project click here We can customize ribbon with two ways in our word addin Ribbon(visual Designer) Ribbon(XML) In this article we will discuss about Ribbon(Visual Designer) control. Adding Ribbon in your project: Select Ribbon (Visual Designer) item and addYou can see built in 'TabAddIns' tab that contains a group without any control. We can add various office ribbon controls from toolbox. You can also set the various properties of the ribbon, tab, group and contained controls from properties windows. You can see Ribbon designer control in Ribbon1.designer.vb file:
The most feature of office 2007 and later version is that these office systems are Ribbon compatible.Basically Ribbon in office system is the user interface element that contains controls. Or you can say ribbon is the parant control of command controls. In this article we will learn that how to customize this ribbon in word application. If you want to see that how to start vsto project click here
We can customize ribbon with two ways in our word addin
Ribbon(visual Designer) Ribbon(XML)
In this article we will discuss about Ribbon(Visual Designer) control.
Adding Ribbon in your project:
Select Ribbon (Visual Designer) item and add
You can see built in 'TabAddIns' tab that contains a group without any control. We can add various office ribbon controls from toolbox. You can also set the various properties of the ribbon, tab, group and contained controls from properties windows.
You can see Ribbon designer control in Ribbon1.designer.vb file:
Adding controls in Ribbon:
Follow these basic steps to design the Ribbon layout:
Controls can be dropped only on groups; you cannot drag a control directly to a tab or to the Ribbon. Groups can be dropped only on tabs; you cannot drag a group directly to a Ribbon.
Event handling:
Suppose you want to add a button on group for adding date time in the document on the click of button. You can drag drop button into the group from office ribbon Controls toolbox tab and you need to write code on its click event
Run this Example: Build the project and Press F5. (word document appeares The Ribbon of the document displays a custom tab.)
Requirements :
This example requires the following applications: Visual Studio Tools for Office. Microsoft Office word 2010.
Pro WPF: Windows Presentation Foundation in .NET 3.0