SIGN UP MEMBER LOGIN:    
ARTICLE

Create Custom Tab in Office Ribbon at Excel/ Word 2007

Posted by Mujeeb Rahman Articles | Office Development March 12, 2010
This Tutorial describes step-by-step method for creating Custom Tab in Excel/Word 2007 at UI Ribbon.
Reader Level:
 


Introduction

Customization of office 2007 application like word or excel is very easy  with Visual studio 2008. Now a day lot of real time business requirement is accomplished by the  Office customization. Office ribbon is providing rich UI and you can add your own custom tab on it very quickly.

This article describes step-by-step method for creating Custom Tab in Excel/Word 2007 at UI Ribbon.  User doesn't need to write a single line of code for achieving the functionality described in this article. All code is automatically generated by Visual Studio 2008 Project Template.

Step-by-step description starting from here.

Step 1: Create new Excel 2007 Add-in project

1.gif

In the solution explorer you can see as following image.

ThisAddIn.cs contain required method for designer Support

2.gif

Step 2 

In this step you can add new ribbon visual Designer to the project.

Right Click on the Project file->Add -> Select New Item in the Office category -> select Ribbon (Visual designer)

3.gif

In the solution explorer you can see RibbonCustom.cs file and also its designer view

4.gif

Step 3

In the designer view of RibbonCustom.cs, from tool box add new Tab in to bottom panel of the Ribbon

5.gif

Step 4 

Now ... You can see the new tab. From Properties of new Tab, you can set your own name and label

6.gif

Step 5

Add your own control to the tab from Tools. Remember that for adding any control first need to add "Group". All controls (like Button, Label, Gallery etc) is the child of Group control 

7.gif

Step 6

Easy ... Press F5 button it will build and run one excel with your custom tab on the ribbon

8.gif

Cool...  Right?  Please Try it.

How to publish the setup of this project?

From Visual studio tool bar Click on Build item and select Publish ExcelAddinCustom Tab and follow the wizard it will create the setup.exe at selected folder

Create Custom Tab for Word 2007

Create New Project and select Word 2007 Add-in template from office category and follow the same step as described for Excel Add-in

9.gif

How to disable the Add-in?

  1. Open Excel file
  2. Click on Top Left Round Button (Microsoft Office Button)
  3. Click on Excel Option Button available at bottom
  4. From Excel Options Dialog Select Add-In Tab
  5. Select COM Add-ins From Manage Combo box , Click Go Button
  6. Uncheck  unwanted Add-ins From COM Add-Ins list

You also get a good information for enable/disable office add-in from Here

http://office.microsoft.com/en-us/help/HA100341271033.aspx

How to permanently remove the Add-in?

Go to Control Panel -> Programs and Features -> Uninstall the setup

Login to add your contents and source code to this article
share this article :
post comment
 

Very Good Contents We can create Add ins using VBA code also but for .net developer this is very easy steps Naveen Mishra MS Excel VBA Developer & Trainer for Corporate Training you can contact on 91-9871115570

Posted by Naveen Mishra May 16, 2012

Visual studio 2008 VSTO is creating a managed Add-In for Office. So For running application in the user machine you have to do the following registry settings

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Office\Outlook\Addins\OutlookAddIn2]
"Description"="OutlookAddIn2 - Outlook add-in created with Visual Studio Tools for Office"
"FriendlyName"="OutlookAddIn2"
"LoadBehavior"=dword:00000003
"Manifest"="C:\\Users\\mujeebr\\Documents\\Visual Studio 2008\\Projects\\OutlookAddIn2\\OutlookAddIn2\\bin\\Debug\\OutlookAddIn2.vsto|vstolocal"

Do copy and paste into notepad , edit according to your Add-in and save as .reg file. Execute it (Remember the above key is for outlook, you have to change accordingly)

Posted by Mujeeb Rahman Sep 29, 2010
Posted by Mujeeb Rahman Sep 24, 2010

Remesh,
In some case the Add-In is found either Disabled ot Not Loaded.
If you are not get any error while deployment, please do the following Checking.

In Exce/Word,  Click Roud Pearl Button -> Slect Word Options (In the case of Word) -> In the Word Option Menu Select Add-Ins Tab -> From the Combo select  'Disabled Items' then Click 'Go..' Button. You can enable the add-in from here(If disabled). Also select COM Add-Ins from combo , It will list all dowload COM Add-In and check whether your Addin is found there or not
 

Posted by Mujeeb Rahman Sep 24, 2010

Hi Mujeeb

Thanks for your information.

As mentioned in your mail, published the project and got the setu.exe with one application folder and one .vsto file. Whne I am trying to install the same in another machine; getting the same issue. (Visual Studio  not installed in that machine). Only Office 2007 is available.

Please share your inputs, how we can deplloye this in another system in which there is not VS2008/2005.


Thanks in Advance
Remesh

Posted by Remesh CP Sep 24, 2010
Team Foundation Server Hosting
Become a Sponsor
PREMIUM SPONSORS
  • The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
    Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
Become a Sponsor