Office add-in basics: support command bar and Ribbon UI,
several Office versions, from 2000 to 2010 in one project

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

Add-in Express Home >

Add-in Express basics

COM add-in programming always starts with implementing the IDTExtensibility2 interface which may present the following difficulties

Modules

An Add-in Express based project (see New Project dialog) includes a file called module. The module is the core component of the project; it represents a COM add-in, Excel UDF, etc. Each module provides a designer accessible in a number of ways. See one of them in the screenshot.

Add-in Module designer

The designer surface of the module incorporates:

  • Commands toolbar - it allows adding Add-in Express components available for the module.
  • Components area - it is what a usual designer provides.
  • In-place designer area - if the visual designer for the currently selected Add-in Express component is available, it is shown in this area.
  • The screenshot below shows the add-in module designer with the in-place designer for the ADXCommandBar component. See also Add-in Express components and Sampe Office COM add-in project.

Add-in Module designer

Host application UI

Add-in Express provides a number of components that allow customizing both the command bar UI and Ribbon UI of Office applications. Creating advanced task panes in Outlook, Word, Excel and PowerPoint version 2000-2010 is also supported. See Add-in Express Components.

Host application events

Add-in Express provides a number of application-specific objects that allow specifying event handlers for application-level events of all Office applications. To handle such events, you need to add an Events object such as Outlook Events or Excel Events to the add-in module and specify event handlers for required events. See Events.

In addition, Add-in Express supplies events classes providing methods in which you write your code to handle this or that event declared in a host application object other than the Application object of the host application.

Supporting several Office versions in the same project

There are two aspects of this theme:

  • Supporting the CommandBar and Ribbon UI in one project

    You can add both Command Bar Components and Ribbon Components components onto the add-in module. When your add-in is loaded in a particular version of the host application, either command bar or ribbon controls will show up. Find additional information in Command Bars in the Ribbon UI.
  • Accessing version-specific features of an Office application

    Please see Choosing interop assemblies.

Developing multiple Office extensions in the same project

Add-in Express supports adding several modules in a project. That means you can create an assembly containing a combination of several Office extensions. Having several modules in an assembly is a common approach to developing Excel extensions; say you can implement a COM add-in providing some settings for your Excel UDF.

What is essential is that all Office extensions will be loaded into the same AppDomain. The only exception is Excel Automation add-ins – they are loaded into the Default AppDomain (but see What Excel UDF type to choose?).

If several Office extensions are gathered in one assembly, Office loads the assembly once but initializes the extensions in the assembly one at a time. That is, if you have two COM add-ins in the same assembly, one of them may be still not initialized when the first one is ready to work. See also HowTo: Create a COM add-in, XLL UDF and RTD server in one assembly.

See also Deploying Office extensions and Accessing public members of your COM add-in from another add-in or application.