Build COM add-in / plugin for Office 2007 - 2000 in Delphi.
Customize Ribbon button, controls, Office menu and toolbar.

Add-in Express™
for Microsoft® Office and CodeGear® VCL

Add-in Express VCL and COM add-ins

Add-in Express VCL is completely based on the Rapid Application Development (RAD) paradigm which makes the development of robust COM add-ins for Microsoft Excel, Outlook, Word, Access, PowerPoint and other applications of MS Office family quicker and easier. Add-in Express provides the following features for COM add-ins:

  • Visual designers, special components and project templates allow you to create sophisticated Office add-ins without coding their GUI.
  • Ability to create both application-specific add-ins, e.g. Outlook or Excel plug-ins, and shared plugins that work on all end-user applications: Outlook, Excel, Word, PowerPoint, Visio, Project, MapPoint, Publisher, Access, FrontPage and InfoPath.
  • Special components for customizing the Office 2007 Ribbon UI (Ribbon button and all Ribbon controls) enable you to add new or customize existing tabs for the Office 2007 Ribbon UI, build the Quick Access Toolbar and the Office Menu. More about Office 2007 Ribbon designer.
  • Add-in Express directly integrates its projects with the Borland's Office Automation Server components and allows you to access add-in host application objects and handle their events.

Also, please keep in mind that Add-in Express offers additional features for enhancing Outlook To-Do bar, Navigation pane, Explorer and Inspector ribbons etc. Also, see our screencasts showing how to develop an Outlook plugin in Delphi with Add-in Express.

The sample below describes creating a COM add-in for Microsoft Excel 2007 and Microsoft Word 2007. Another sample COM add-in for Office 2000-2007 is available in the Developer's Guide. 

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

In the Delphi IDE, close all opened projects, select the "File|New|Other:" item on the main menu, and run  the "Add-in Express COM Add-in" wizard on the "Add-in Express VCL" tab of the "New Item" dialog box. In the wizard windows, you enter the name and the destination folder for the add-in project, select either user or admin privileges for the add-in installation, and specify task panes information (Office 2007 only). The wizard then generates a new project and opens it in the Delphi IDE.

Create a COM add-in project with a wizard.

The project includes the Add-in Module (MyAddin1_IMPL.pas on the screenshot above), which is the core part of Add-in Express based add-ins. The Add-in module supports all Office versions (Office 2000, 2002, 2003, and 2007) and allows you to concentrate all code of the add-in in one place. The Add-in module and other Add-in Express components apply the True RAD approach for COM add-in development.

2. Customizing your Office add-in

You set the add-in module properties and add Add-in Express components to customize the Office 2007 Ribbon user interface, Office menu, and Quick Access Toolbar. In Office 2000, 2002, 2003, and 2007 you can customize command bars including menus, toolbars, and context menus.

Technical information:

Add-in name, description, and load behavior
Supported Office applications
Collection of custom task panes (Office 2007 only)
Collection of command bars (all Office versions)
Host application interface
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 the Ribbon XML markup is loaded
Before and after the add-in is registered
Find CommandBar
Find CommandBar control
Find Ribbon control

Add-in Express includes the following components used in the Add-in Module:

  • Ribbon Tab
  • Ribbon Office menu
  • Quick Access Toolbar
  • Command bar
  • Outlook Explorer CommandBar 
  • Outlook Inspector CommandBar
  • Built-in CommandBar Control Connector
  • Outlook Bar Shortcut Manager
  • Keyboard Shortcut

3. Adding custom Office 2007 Ribbon tab

Add an instance of the Ribbon Tab component (TadxRibbonTab) to the module and populate the tab with controls using a treeview-like editor. You can add any Ribbon control to the Ribbon tab.

Adding a custom Ribbon button

The Ribbon Tab component creates and verifies the Office 2007 Ribbon XML markup automatically.

Technical information:

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

4. Adding custom Office 2007 menu

Add an instance of the Ribbon Office Menu component (TadxRibbonOfficeMenu) to the module and populate it using a treeview-like editor. The component supports adding the following Ribbon controls:

  • Ribbon Button
  • Ribbon SplitButton
  • Ribbon CheckBox
  • Ribbon Gallery
  • Ribbon MenuSeparator

Adding custom Office menu items

The Ribbon Office Menu component creates and verifies the Office 2007 Ribbon XML markup automatically.

Technical information:

Supported ribbons
Controls collection

5. Adding custom task pane in Office 2007

The Add-in Express COM Add-in project wizard creates custom task panes you need and adds them to the project. In the Developer's Guide you can read how to add a task pane to an existing Add-in Express project.

6. Adding a command bar

To add a command bar to your add-in, drop a TadxCommandBar component onto the add-in module. Then specify the command bar properties and populate it with controls. Available control types follow below:

  • CommandBar Button
  • CommandBar Edit
  • CommandBar ComboBox
  • CommandBar DropDownList
  • CommandBar Control

Adding a custom command bar

Technical information:

Commandbar name, position, and protection
Supported Office applications
Temporary
Visible
Collection of command bar controls
Flag, specifying if the commandbar will show up in the Ribbon interface

7. Adding a new button to the Office toolbar

Right-click on the toolbar component and select the Controls item on the popup menu. In the Editing Controls window, select the Button item on the Add New popup button:

Adding a custom command bar button

8. Running the add-in

Save the project, compile it, close all the applications that you have selected as add-in host applications, and register the add-in via "Run|Register ActiveX Server". Run one of the selected host applications, find your Ribbon tab or toolbar and click on the button:

A sample add-in for Word 2007 A sample add-in for Excel 2007

 




Client login

 

Login 

Password 

 

Remember me

Forgot my password



Developing an add-in in Delphi - video