Build Office 2007 - 2000 add-in / plugin: C#, C++, VB.NET.
Create custom task panes, ribbon tabs, keyboard shortcuts.

Video HowTo - Create Excel COM add-in step-by-step

Add-in Express™
for Microsoft® Office and .net

Add-in Express .NET and COM add-ins

The feature-rich technology of Add-in Express for Office and .NET makes COM add-ins / plugins development quick and easy. Add-in Express implements everything required by the supported technologies and you concentrate on the applied code only. You write the code in Visual C#, Visual C++ .NET, Visual Basic .NET and Delphi Prism.

Using visual designers and special components of Add-in Express, you can create new or customize existing toolbars, menus and sub-menus for Office 2000 – 2007, add new to the Office 2007 Ribbon UI, build the Quick Access Toolbar and Office Menu, add custom task panes and more. You may also want to have a look at a free sample Excel add-in in .NET and Word add-in in NET.

Now let's build a sample COM add-in project for Excel 2007. You can find the most recent documentation in the Add-in Express Developer Guide about how to create a COM add-in for Office 2007 – 2000.

1. Create a new COM add-in project with Add-in Express wizard

Run the Add-in Express COM Add-in wizard located in the "Other Projects | Extensibility Projects" item of the "New Project" dialog box, choose the programming language, and specify the host application for your add-in.

Wizard for creating the Office COM add-in

  • You can use any programming language to develop add-ins for any combinations of Office applications from all Office suits (editions).
  • You can use the oldest possible PIAs (Primary Interop Assemblies) available for the host application without installing the oldest version on your PC.
  • The COM Add-in Project wizard creates both COM Add-in project and the Setup project automatically.

2. COM Add-in module

AddinModule.vb (AddinModule.cs) is the heart of your add-in. You place components onto the Add-in Module designer in order to create the user interface of your Office add-in. You also write the code of your add-in to the Add-in module. 

COM Add-in designer

Benefits:

  • All Office applications, versions, and editions
  • One place for your interface-related code
  • Rapid Application Development approach is applied to add-ins for the first time
  • Several add-ins in one assembly – just add another Add-in Module to your COM Add-in project

Essential technical information:

Add-in name, description, and load behavior
Supported Office applications
Collection of custom task panes (Office 2007)
Host application name, type, version, and object
When the add-in completes start-up routines or is required to shut down
Before and after a custom task pane is created or shown, before a task pane is destroyed
Before the ribbon XML markup is created and loaded, after ribbon XML markup is loaded

3. Office 2007 Ribbon UI (user interface)

Add appropriate Ribbon components to the Add-in module and use their editors to customize the Ribbon UI of your add-in in Office 2007. Naturally, the Ribbon UI customization is available only when your add-in is run in Office 2007. More about customizing Office 2007 Ribbon UIQuick Access Toolbar and Office Menu.

Customizing Office 2007 Ribbon interface

Benefits:

  • You make Office 2007 XML markup with components.
  • Simple properties apply your custom Ribbon tabs or Ribbon Office menu items to any Ribbon-enabled Office 2007 application.

Essential technical information:

Ribbon tab caption and position
Supported ribbons and context (say, Pivot Table in Excel or table in Word)
Visible (Boolean)

4. Office 2007 custom task panes

To create a custom task pane for Excel, add a UserControl to your project, add an item to the TaskPanes collection, and set up the item by choosing the UserControl in the ControlProgId property and filling in the Title property. More about building custom Excel task panes.

Creating custom task panes in Office 2007

Benefits:

  • You use familiar technologies to create Office 2007 custom task panes.

Essential technical information:

Task pane title, width and height
The UserControl bound to the task pane
Dock position and dock position restrictions
Supported Ribbon-enabled applications
Visible (Boolean)
When the user changes the dock position or the visible state of the task pane
Before and after a custom task pane is created or shown, before a task pane is destroyed

5. Traditional command bars and command bar controls

Add a CommandBar component to the Add-in Module and populate its Controls collection using a handy editor.

Creating command bars at design-time

Benefits:

  • Use the CommandBarName property to create or connect to custom and built-in toolbars, menus, and context menus.
  • Adding any custom .NET controls to Office toolbars with Toolbar Controls for Microsoft Office.

Essential technical information:

Command bar name, description, position, and protection
Boolean properties: Temporary, Enabled, and Usable for Ribbon-enabled applications
Collection of command bar controls: buttons, combo boxes, dropdown lists, edits, popups.
Click - for command bar button
Change – for command bar combo box, dropdown list, and edit
All events for custom .NET controls

6. Keyboard shortcuts in Office add-ins

Add a Keyboard Shortcut component to the Add-in module and specify the shortcut you need to intercept.

Intercepting Office keyboard shortcuts

Then you handle the Action event of the component.

 Private Sub MyActionProc(ByVal sender As System.Object) _
 Handles AdxKeyboardShortcut1.Action
 MsgBox(AdxKeyboardShortcut1.ShortcutText + " has been pressed!")
 End Sub 

Benefits:

  • This useful component just saves your time.

Essentials:

Enabled (Boolean)
Shortcut Text
Supported Office Applications
Action

7. Deploying the COM add-in

Add-in Express add-ins are based on the Add-in Express Loader which is a feature-rich shim and bootstrap application.

Deploying the COM add-in

With automatically generated setup project, the Add-in Express Loader provides you with the following benefits:

  • Manifest-configured features: setup log, non-admin installation, updating an add-in  while it is loaded
  • Ready-to-use custom actions for your setup project
  • Per-user and per-computer add-in installations
  • You can sign the Add-in Express Loader with a digital certificate thus making your add-ins trusted

More about deploying Office add-in using shims and Add-in Express Loader.

Please note that Add-in Express offers special features for Outlook plug-in development, namely for extending Outlook menu, toolbar and ribbons and customizing Outlook bar, Navigation and Reading panes.

Building COM add-ins, smart tags, RTD servers on .NET - Flash video