Blue Theme Orange Theme Green Theme Red Theme
 
Team Foundation Server Hosting
Home | Forums | Videos | Advertise | Certifications | Downloads | Blogs | Interviews | Jobs | Beginners | Training
 | Consulting  
Submit an Article Submit a Blog 
 Jump to
Skip Navigation Links
TechnologyExpand Technology
WebsiteExpand Website
Discover the top 5 tips for understanding .NET Interop
Search :       Advanced Search »
Home » Office Development » Create Custom Tab in Office Ribbon at Excel/ Word 2007

Create Custom Tab in Office Ribbon at Excel/ Word 2007

This Tutorial describes step-by-step method for creating Custom Tab in Excel/Word 2007 at UI Ribbon.

Page Views : 18065
Downloads : 226
Rating :
 Rate it
Level : Beginner
   Print Read/Post comments Post a comment  Similar Articles  
   Email to a friend  Bookmark  Author's other articles  
Download Files:
ExcelAddInCustomTabCode_Src.zip
 
 
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor
 Tag Cloud
 Latest Jobs
More ... 
 Latest Interview Questions
More ... 



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

Comment Request!
Thank you for reading this post. Please post your feedback, question, or comments about this post Here.
Login to add your contents and source code to this article
 [Top] Rate this article
 
 About the author
 
Mujeeb Rahman

4+ years of extensive experience in Business Analysis, Implementation, Solution Providing, Designing, Developing, and testing of distributed applications.
Hands on experience in handling Multiple Projects simultaneously. Strong experience implementing enterprises distributed application using C#, VB.Net and Winform. VSTO(Visual studio Tools for office) expert and successfully executed many project for Excel, Word and Outlook. Depth knowledge in .Net 3.5 with design and development experience in WCF and WPF application.
Currently Working in Orion India System Ltd. Kochi

Looking for C# Consulting?
C# Consulting is founded in 2002 by the founders of C# Corner. Unlike a traditional consulting company, our consultants are well-known experts in .NET and many of them are MVPs, authors, and trainers. We specialize in Microsoft .NET development and utilize Agile Development and Extreme Programming practices to provide fast pace quick turnaround results. Our software development model is a mix of Agile Development, traditional SDLC, and Waterfall models.
Click here to learn more about C# Consulting.
 
Introducing MaxV - one click. infinite control. Hyper-V Hosting from MaximumASP.
Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Dynamic PDF
ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
Discover the Top 5 .NET Memory Management Fundamentals
To write the best .NET code, you need to know exactly how the .NET framework really manages memory. Ricky Leeks presents the Top 5 fundamental facts of .NET memory management. Learn more.
Nevron Chart for .NET 2010.1 Now Available
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.
ASP.NET 4 Hosting
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!
 
 Post a Feedback, Comment, or Question about this article
Subject:
Comment:
Team Foundation Server Hosting
Become a Sponsor
 Comments
create a custom task pane that users can hide or display by clicking a toggle button on the Ribbon using c#.net2.0 with vsto by aravind On March 18, 2010
hai::
I  want create a custom task pane that users can hide or display by clicking a toggle button on the Ribbon. You should always create a user interface (UI) element, such as a button, that users can click to display or hide your custom task pane, because Microsoft Office applications do not provide a default way for users to show or hide custom task panes.

Software Used:

       .net 2.0 and c#,Vsto

 

Can u give the Steps For that

Reply | Email | Modify 
Re: create a custom task pane that users can hide or display by clicking a toggle button on the Ribbon using c#.net2.0 with vsto by Mujeeb On March 19, 2010
I found the link for creating custom Task Panes in the 2007 Office system

http://msdn.microsoft.com/en-us/library/aa338197.aspx

I didn't try the code in the above link. Please let me know if you have any doubt
Reply | Email | Modify 
Re: create a custom task pane that users can hide or display by clicking a toggle button on the Ribbon using c#.net2.0 with vsto by Mujeeb On March 30, 2010
From visual studio 2008 you can easily create a custom task pane
Described in this link
http://www.c-sharpcorner.com/Forums/ShowMessages.aspx?ThreadID=81717



Reply | Email | Modify 
create a custom ribbon using vc++ by divya On May 24, 2010

Can you please explain me, how to create a custom ribbon in word, which has brief features of printing a document.
It would be helpful if you provide step by step information or sample project.

Reply | Email | Modify 
Re: create a custom ribbon using vc++ by Mujeeb On May 25, 2010
Are you expecting the solution in VC++? I can help you only for VB.Net or C# solution.
For creating Custom Tab for Word 2007, in Visual studio 2008 create New Project and select Word 2007 Add-in template from office category and follow the same step as described for Excel Add-in(this article). Please have a look on the last screen shot image
Reply | Email | Modify 
Unable to see the Custom Ribbon after deployment by Remesh On September 23, 2010

Hi,

We have created custom ribbon mentioned in the sample. we are able to see the custom ribbon, in the development machine.

Also please let me know how we can deploy the same ribbon dll in end user machine.
We tried to create a setup file and install in other machine (Office 2007 installed). But when opening Word 2007, the custom ribbon is not displaying.

Please help us to resolve this.

Thanks
Remesh


Reply | Email | Modify 
Re: Unable to see the Custom Ribbon after deployment by Mujeeb On September 23, 2010

Hi Remesh

In Visual Studio 2008 at Menu Bar You can see Buid Button. While clicking it , will open a context menu containg 'Publish YourAddin item' , it will open a wizad for creating an  setup.exe installer for you add-in

Menu Bar Build Button -> Publish Addin -> Follow the Wizard -> Create setup.exe to the selected location

Hope this information will help you. Feel free to ask any question.

Regards
Mujeeb

Reply | Email | Modify 
Re: Re: Unable to see the Custom Ribbon after deployment by Remesh On September 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
Reply | Email | Modify 
Re: Re: Re: Unable to see the Custom Ribbon after deployment by Mujeeb On September 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
 

Reply | Email | Modify 
Re: Re: Re: Re: Unable to see the Custom Ribbon after deployment by Mujeeb On September 24, 2010
Reply | Email | Modify 
Re: Re: Re: Re: Re: Unable to see the Custom Ribbon after deployment by Mujeeb On September 29, 2010

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)

Reply | Email | Modify 

 © 2012  contents copyright of their authors. Rest everything copyright Mindcracker. All rights reserved.