Outlook programming in Delphi. Develop add-in / plugin
for Outlook 2007, 2003 - 2000: toolbars, menus, ribbons.

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

Writing Outlook add-ins

Add-in Express for Delphi VCL allows you to write a Microsoft Outlook COM add-in / plugin in Delphi with minimal efforts and time. It provides several Outlook specific features that are a "hard nut" to release using Outlook objects. The features are: special Outlook Explorer command bars, special Outlook Inspector command bars, Advanced Outlook Regions, option pages and property pages, context sensitivity for command bars and option / property pages.

Key features of Add-in Express for Outlook plugins:

  • Visual designers and project-specific components of Add-in Express for customizing the Office 2007 Ribbon UI as well as the old-style Outlook GUI, which makes equally easy to create new or customize existing ribbons, ribbon tabs, task panes on Outlook 2007 and to build toolbars, menus and sub-menus on Outlook 2000 - 2003.
  • Special components for customizing Outlook windows, Outlook Today, Navigation and Reading panes, Outlook bar with Advanced Form Regions in Outlook 2000 - 2007.
  • Special command bar components for adding new toolbars to the Outlook Explorer and Inspector windows.
  • Outlook-specific components for adding Outlook option and property pages, intercepting events and shortcuts of any built-in controls and embedding your code into built-in event handlers. 
  • Add-in Express directly integrates its projects with the Borland's Office Automation Server components and allows you to access Outlook objects and handle their events.

For more information about creating an Outlook plug-in, please see the video for developing Outlook add-in in Delphi. Also, you may find useful a free sample Outlook add-in in Delphi with source code.

Example of developing an Outlook add-in

With Add-in Express VCL writing COM add-in / plugin for Microsoft Outlook 2000, Outlook 2002 (XP), Outlook 2003, and Outlook 2007 is easier than ever before. Below you can see a step-by-step instruction on how to add a custom Ribbon tab to Outlook 2007, build a command bar and custom task pane, create property pages and option pages for Outlook 2007 in Delphi. In the Add-in Express Developer Guide, you can find one more example of writing a COM add-in for Outlook 2000-2007.

1. Create a new Outlook COM add-in project 

In the Delphi IDE, close all opened projects, select the "File|New|Other..." item on the main menu, and run the "Outlook Add-in" wizard on the "Add-in Express VCL" item category of the "New Items" dialog box. On the wizard pages, you specify if your add-in will be installed with administrative or user privileges, define option and property pages and task pane.

Create an Outlook COM add-in project using a wizard.

The wizard generates a new project, adds the defined property pages as active forms, and opens the project in the Delphi IDE. The Add-in module - a special component for programming Outlook add-ins with Add-in Express - is the heart of your Outlook add-in project.

2. Customize Outlook Add-in module

The add-in module is a placeholder for add-in components: toolbars, ribbon tabs, keyboard shortcuts, etc. You find an appropriate component in the Add-in Express tab on the Tool Palette and add the component to the module.

The add-in module also presents you with add-in properties, events and useful methods:

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

3. Add a custom Ribbon tab to an Outlook 2007 Inspector window

In the Tool Palette, select the Add-in Express tab, find the Ribbon Tab component, and add it to the add-in module. Specify the controls to be located on the tab using a friendly treeview-like editor.

Adding a custom Ribbon button

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. Customize Office Menu in Outlook 2007

The task is easily solved with the Ribbon Office Menu component located on the Add-in Express tab on the Component Palette.

Adding custom Office menu items

Technical information:

Supported ribbons
Controls collection

5. Add custom task panes in Outlook 2007

Use the Add-in Express project wizard to define custom task panes. Add-in Express documentation also shows how to add a task pane to an existing Add-in Express project. So, all you need is flourish the task panes with controls and handle their events.

Custom task panes in Outlook

6. Add custom options and property pages in Outlook 2000 - 2007

Using the Add-in Express project wizard you define property pages to be added to the Options dialog box (on the Tools menu) or to the Properties dialog box for a given folder (or all folders). The wizard creates the property and options pages (TActiveForm descendants) and adds a sample TEdit control as well as a code sample that demonstrates controls' events processing.

Custom property pages in Outlook

7. Customizing Outlook Today

Some Add-in Express product packages include the Advanced Outlook Regions feature. Unlike the standard way of customizing Outlook Today with HTML and VBScript, this feature allows you to completely replace the folder view with a custom .NET form. More about customizing Outlook views in Outlook Today style.

8. Create a custom command bar in Outlook

Add-in Express provides two special Outlook command bar components: Outlook Explorer commandbar and Outlook Inspector commandbar. The components take into account Outlook multi-Explorer and multi-Inspector windowing system. They also provide context-sensitivity: you can specify any given or all folders that toolbar will be shown for. You can also narrow down the folder list  by specifying the default item type.

You can also connect an Outlook command bar component to a built-in command bar: just specify the name of a built-in or an existing toolbar in the CommandBarName property. The commandbars provide a property for preventing toolbar showing in the Outlook 2007 Ribbon UI (it is available for Outlook 2007 Inspector windows only).

Custom Outlook Explorer commandbar

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 (UI)

9. Add a command bar button on an Outlook toolbar

The Controls collection editor of Add-in Express provides you with a simple way to populate a command bar with controls:

Adding a custom commandbar button to Outlook Explorer windows

 




Client login

 

Login 

Password 

 

Remember me

Forgot my password



Developing an add-in in Delphi - video