RSS

Add a custom Ribbon to Word 2010 using C#

18 Oct

Create a VisualStudio project, in the template, select Word2010 Addin:

OfficeTaskPane_A_thumb

Word 2010 addin template: Application-level add-ins
Word 2010 document: Document-level customizations

Project > Add a new item, select “Ribbon (Visual Designer)”

OfficeRibbon_A

Drag some controls from the toolbox

OfficeRibbon_A2

OfficeRibbon_B1

OfficeRibbon_B2

Consume the Ribbon in C#: Add below code:

protected override Office.IRibbonExtensibility CreateRibbonExtensibilityObject() { return Globals.Factory.GetRibbonFactory().CreateRibbonManager ( new Microsoft.Office.Tools.Ribbon.IRibbonExtension[] { new RobotRibbon() } ); }

Compile and run:

OfficeRibbon_DOfficeRibbon_D2OfficeRibbon_D3

 
1 Comment

Posted by on October 18, 2010 in Programming

 

One response to “Add a custom Ribbon to Word 2010 using C#

  1. Carlos

    November 20, 2014 at 7:55 pm

    will this work on Word for Mac? Since .NET is now open source, I was wondering if this would work using asp.net vNext?

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: