How to develop IE add-on in VB.NET, C#, C++
for Internet Explorer 6 - IE11

Add-in Express™
for Internet Explorer® and Microsoft® .net

Add-in Express Home > Add-in Express for Internet Explorer > Online Guide > Programming Internet Explorer addons

Creating an IE add-on project

Make sure that you have administrative permissions before running Visual Studio. Also, if you have Windows Vista, Windows 7, Windows 8, or Windows 10, run Visual Studio via Run as Administrator.

In Visual Studio, open the New Project dialog and navigate to the Extensibility folder.

Creating a new ADX IE add-on project

Choose Add-in Express IE Add-on and click OK. This starts the IE Add-on project wizard. Then choose your programming language and the minimum Internet Explorer version that you want to support and click Next.

Choosing VB.NET as the programming language and IE 6 as the oldest version your add-on needs to support

Choosing a particular Internet Explorer version will add corresponding interop assemblies to the project. Later on, in case you need to support an older or a newer IE version, you will be able to replace interop assemblies and reference them in your project. If you are in doubt, choose Internet Explorer 6 as the minimum supported Internet Explorer version and your add-in will work in all versions, from IE6 to IE11. If you need background information, see What are interop assemblies?.

Creating strong names

If you don't know anything about strong names or don't have a special strong name key file, choose Generate new. If you are in doubt, choose Generate new. If you need to use a specific strong name key file at a later point of time, you will be able to specify its name on the Signing tab of your project properties; you are required to unregister your toolbar project before using another strong name.

Choose Generate new or specify an existing .snk file and click Next.

The project wizard creates and opens a new solution in Visual Studio.

ADX IE add-on solution in Visual Studio

The solution contains the only project, IE add-on project. The project contains the IEModule.vb (or IEModule.cs) file discussed in the next step.

IE Module

IEModule.vb (or IEModule.cs) is the core part of the project. It is a container for components essential for the functionality of your add-on. You specify add-on properties in the module's properties, add the components to the module's designer, and write the functional code of your add-on in this module. To review its source code, in the Solution Explorer, right-click IEModule.vb (or IEModule.cs) and choose View Code in the popup menu.

Solution Explorer - View Code

In the code of the module, pay attention to the following points:

  • the comment line in the constructor of the module

    It suggests that you write any initialization code in the OnConnect event of the module, not in the constructor. Why? The fact is that an instance of the module is created when the Internet Explorer extension is being registered or unregistered. That is, the constructor of the module can be executed when the module isn't loaded in IE and if your code doesn't expect this, an exception may occur. On the other hand, OnConnect is the very first event the module generates when it is loaded into IE. So, following this recommendation saves your debugging time.

  • the IEApp and HTMLDocument properties

    These properties are added by the Internet Explorer add-on project wizard. You use them as entry points to the corresponding object models; see Intercepting IE Events and Intercepting HTML Events.

IE Module designer

In the Solution Explorer, right-click the IEModule.vb (or IEModule.cs) file and choose View Designer in the popup menu.

Solution Explorer - View Designer

The designer view provides access to the following three areas:

  • Add-in Express Toolbox - (#1 in the screenshot below) it contains commands; clicking a command adds a corresponding Add-in Express component onto the module;
  • IE module designer - (#2 in the screenshot below) it is a usual designer;
  • Help panel - see #3 in the screenshot below.

IE Module designer

The module provides a number of properties and commands. The properties are available in the Properties window when you click the designer surface of the module. The commands are available in the context menu of the module's designer.

IE add-on development in full details

See the following pages:

Running the Internet Explorer add-on

Register the add-on and restart IE. To register the add-on, choose Register Add-in Express Project in the Build menu.

Debugging the Internet Explorer add-on

To debug an IE extension, you need to use Attach to Process in the Debug menu. See How to: Attach to a Running Process.

Deploying the Internet Explorer add-on

Note that IE add-ons must be registered in HKEY_LOCAL_MACHINE (HKLM) and, consequently, administrative permissions are required when installing an IE add-on. The table below contains links to corresponding step-by-step instructions describing installing and updating an IE add-on.

How you install the IE extension

Deployment technology

A user runs the installer from a CD/DVD, hard disk or local network location. Windows Installer
ClickTwice :)
A user runs the installer by navigating to a web location or by clicking a link. ClickTwice :)

What's next?

IE may run multiple windows and processes. Accordingly, multiple instances of your add-on can be created, each instance running in a different thread and even process. Check IE Essentials where we describe how to deal with this.

Add-in Express for Internet Explorer <<

>> Creating custom IE toolbars