Create Office add-in in VB .NET - HOWTO for MS Outlook, Excel
PowerPoint, Project and Frontpage

VB.NET HowTo samples

Note. The most recent VB.NET examples are published on our technical blog. Be sure to check it out regularly, we add new HowTo samples every week.

Outlook general

How to develop a Microsoft Outlook add-in in VB.NET

This Outlook VB.NET solution for VS 2005 is described in Add-in Express for .NET documentation (see How to build an Outlook COM add-in). From this example you will learn how to:

  • Develop an add-in that supports all Outlook versions: from Outlook 2000 to Outlook 2007.
  • Build Outlook-specific command bars and command bar controls.
  • Create Office 2007 Ribbon controls in Ribbon tabs and Office menu.
  • Create and control Office 2007 task panes.
  • Add custom property pages to the Tools | Options and Folder Properties dialogs.
  • Handle application-level events.
  • Handle events of the Items collection (add, remove, or change Outlook Items).
  • Handle keyboard shortcuts.
  • Use version-neutral Office interop assemblies.

Find the complete list of features on the Developing Outlook plug-in page. See also Add-in Express video demonstrating how to create Outlook 2007 plug-in.
Available downloads:Sample add-in for VS 2005                 Sample add-in for Outlook 2003/2007 (VSTO 2005 SE)

How to handle the ItemSend event of MS Outlook in VB.NET

This VB.NET plug-in shows how to handle the ItemSend event in Microsoft Outlook 2000 - 2007. You often need this when developing Outlook plug-ins.
Available downloads:
Sample add-in for VS 2005                 Sample add-in for VSTO 2005 SE

How to scan Outlook folders in VB.NET

This VB.NET example demonstrates how to scan folders in Outlook 2000, XP, 2003 and 2007 to get a tree view list of folders.
Available downloads:Sample add-in for VS 2005                 Sample add-in for VSTO 2005 SE

How to handle Outlook SelectionChange event in VB .NET

This Outlook VB.NET addin will be useful for novices in Outlook programming.
Available downloads:
Sample add-in for VS 2005                 Sample add-in for VSTO 2005 SE

How to get access to the MAPIFolder within Outlook Property Page

When dealing with Outlook Property or Option pages, you often need to access the add-in module. Download this VB.NET example to see how to do it correctly.
Available downloads:Sample add-in for VS 2005                 Sample add-in for VSTO 2005 SE

How to handle the ExplorerClose event (Outlook) in Visual Basic

This Outlook example may be useful if you are making your first steps in Outlook programming.
Available downloads:
Sample add-in for VS 2005                 Sample add-in for VSTO 2005 SE

How to add custom menu items to the popup menu in Outlook Explorer

This sample addin demonstrates the tremendous abilities of Add-in Express for customizing Outlook Explorer and Inspector toolbars and menus. It shows how to populate the context menu of Outlook Explorer with your own menu items.
Available downloads:
Sample add-in for VS 2005                 Sample add-in for VSTO 2005 SE

How to create an Outlook command bar and command bar controls at run time

This Outlook VB.NET sample shows how to add a new button to your Outlook toolbar.
Available downloads:
Sample add-in for VS 2005                 Sample add-in for VSTO 2005 SE

How to add a .NET control to a custom Outlook toolbar

A UserControl is added to a new toolbar to handle the SelectionChange event of Outlook Explorer and to display some info of the currently selected MailItem. This Outlook VB.NET example is written for Visual Studio 2005 and 2008. See a step-by-step sample project showing how to enhance Outlook toolbar with custom .NET controls. See also a flash video showing how to customize Outlook 2003 toolbar.
Available downloads:
Sample add-in for VS 2005                 Sample add-in for VSTO 2005 SE

Advanced Outlook Regions

How to move a custom .NET form embedded into Outlook window from one form region to another

This sample VB.NET add-in for Visual Studio 2005 shows how you can change layouts of custom .NET forms embedded into Outlook windows. The add-in creates a command bar (a Ribbon tab in Office 2007) and allows choosing the layout from a combo box. The form used in this sample processes the SelectionChange event of Outlook Explorer. Please note, you may need to change the references for the project to compile.
Available downloads:
Sample add-in for VS 2005                 Sample add-in for VSTO 2005 SE

How to cache forms embedded into Outlook Explorer windows

This VB.NET add-in for Visual Studio 2005 demonstrates the Advanced Outlook Form Region caching functionality available for forms embedded into Outlook Explorer windows. The developer can use this functionality to preserve form data when the user switches between folders. There are three caching options for such forms: Non-cached, NewInstanceForEachFolder, and OneInstanceForAllFolders. Forms embedded into Outlook Inspector windows are always non-cached. More about customizing Outlook Explorer views.
Available downloads:
Sample add-in for VS 2005                 Sample add-in for VSTO 2005 SE

How to change the size of a form embedded into an Outlook window

This sample plugin written in VB.NET demonstrates the form-sizing features available for Advanced Form Regions in Outlook 2000 - 2007. There are two options depending on the visibility of the splitter (as set by the developer): if the splitter is visible, the user can change the form size and the developer cannot. To change the Outlook form size programmatically, the developer sets the Splitter property to None.
Available downloads:
Sample add-in for VS 2005                 Sample add-in for VSTO 2005 SE

How do you identify the instance of the form embedded into an Outlook window?

This VB.NET Outlook sample add-in shows several forms marked with a GUID. When you click a command bar button (a Ribbon button in an Outlook 2007 inspector), the add-in identifies the currently active form instance and shows its GUID.
Available downloads:
Sample add-in for VS 2005                 Sample add-in for VSTO 2005 SE

Controlling the visibility of a custom form in Outlook

This sample plug-in for Visual Studio 2005 demonstrates the typical use of forms embedded into Outlook windows: hiding and showing the form in Explorer and Inspector windows.
Available downloads:
Sample add-in for VS 2005                 Sample add-in for VSTO 2005 SE

Several forms in the same Advanced Outlook form region

This sample add-in in VB.NET demonstrates how to use several forms in the same Advanced Form Region. Click on a RadioButton on the Controlling form to activate the corresponding ADXOlForm.
Available downloads:
Sample add-in for VS 2005                 Sample add-in for VSTO 2005 SE

How to switch between the standard Outlook Explorer view and a custom form

This sample Outlook add-in shows how you can switch between the standard explorer view and a custom ADXOlForm form using Advanced Outlook Regions.
Available downloads:
Sample add-in for VS 2005                 Sample add-in for VSTO 2005 SE

Outlook Extended MAPI

How to create and delete hidden Outlook items via Extended MAPI

This sample Visual Basic .NET solution for VS 2005 accompanies the How to get access to hidden Outlook items via Extended MAPI article on the blog. It demonstrates how to get, create and delete a hidden item in Outlook and Exchange with MAPI Store Accessor in VB.NET.
Available downloads:
Sample add-in for VS 2005

Outlook security

How to disable Outlook security in a COM add-in?

This example shows how to suppress the Outlook security object model guard in Visual Basic .NET.
Available downloads:
Sample for VS 2005

How to disable Outlook security in a standalone application?

This HowTo example switches off the Outlook security guard and sends messages using a custom form.
Available downloads:
Sample for VS 2005

How to disable security warnings which show up when I use the Outlook object model, CDO, or Simple MAPI?

This VB.NET example disables Outlook, Simple MAPI and CDO security and shows the info of the first email.
Available downloads:
Sample for VS 2005

Excel general

How to develop a COM add-in for Microsoft Excel

This sample Excel COM add-in shows how you can use Add-in Express for VSTO to add custom command bars and command bar controls, place new Ribbon controls onto Office 2007  Ribbon tabs, create custom task panes, handle application-level events and more.
Available downloads:
Sample add-in for Excel 2003 (VSTO 2005 SE)

How to build your first RTD server in VB.NET

See how to build an Excel RTD server step-by-step in the Add-in Express Developer's Guide. The sample RTD server project is written in Visual Basic .NET (VS 2005). See also Add-in Express video showing how to create an RTD server.
Available downloads:
Sample for VS 2005

How to handle the WorkbookBeforeSave event of MS Excel in VB.NET

If you develop a COM add-in for Microsoft Excel, you may find this example useful.
Available downloads:
Sample add-in for VS 2005                 Sample add-in for VSTO 2005 SE

User-defined functions

How to develop Excel Automation add-in

See how to create Excel Automation add-ins step-by-step in the Add-in Express Developer's Guide. The sample Excel Automation add-in is written in VB.NET (VS 2005).
Available downloads:
Sample add-in for VS 2005

Advanced Excel Task Panes

How to show / hide Advanced Excel Task Panes programmatically

This Visual Basic .NET sample addin for Microsoft Excel demonstrates how to set the visibility of Advanced Excel Task Pane to make it show up from the command bar.
Available downloads:
Sample add-in for VS 2005                 Sample add-in for VSTO 2005 SE

How to switch between several Advanced Excel Task Panes programmatically

This VB.NET add-in shows how you can use several Excel task panes in one position and switch between them programmatically.
Available downloads:
Sample for VS 2005                 Sample add-in for VSTO 2005 SE

How to show an Advanced Excel Task Pane dynamically

The VB.NET sample for Excel shows how to build a context-dependent Advanced Excel Task Pane. The add-in shows a task pane when cell A1 contains any value.
Available downloads:
Sample add-in for VS 2005                 Sample add-in for VSTO 2005 SE

How to re-size an Excel task pane in VB.NET

This Visual Basic .NET example shows how you can resize your custom Excel form using Advanced Task Panes for Excel 2000-2007. To change the form size programmatically, you set the splitter to none. Otherwise, only the user can resize the Excel task pane using the splitter.
Available downloads:
Sample add-in for VS 2005                 Sample add-in for VSTO 2005 SE

PowerPoint

How to handle the SlideShowBegin event on presentation objects in PowerPoint

This sample shows how to handle the SlideShowBegin event of the PowerPoint presentation objects in VB.NET
Available downloads:Sample add-in for VS 2005                 Sample add-in for VSTO 2005 SE

FrontPage

How to handle the FrontPage OnWindowActivate event in VB .NET

This sample shows how to handle the FrontPage OnWindowActivate event in VB.NETS
Available downloads:
Sample add-in for VS 2005

Project

How to handle the TaskChange event of MS Project in Visual Basic

This sample shows how to handle the TaskChange event of Microsoft Project in VB.NET
Available downloads:
Sample add-in for VS 2005

Microsoft Office general

How to create a Microsoft Office add-in

This Visual Basic .NET solution for VS 2005 is described in Add-in Express documentation (see Creating your first Office add-in). It demonstrates the following features of Add-in Express for .NET:

  • A single add-in supporting all versions of several Office applications (for instance, Excel and Word)
  • Command bars and command bar controls
  • Office 2007 Ribbon controls in Ribbon tabs and Office menu
  • Office 2007 task panes
  • Application-level event handling
  • An event class for handling worksheet events
  • The use of version-neutral Office interops

Find the complete list of features on Developing Office add-ins page. See also Add-in Express video showing how to build Office add-in.
Available downloads:
Sample add-in for VS 2005 

How to change properties of a CommandBarComboBox (ADXCommandBarComboBox) at run time

This sample plug-in shows how to change the ADXCommandBarComboBox properties at run-time in VB.NET.
Available downloads:
Sample add-in for VS 2005                 Sample add-in for VSTO 2005 SE

How to program a smart tag

Find how to program smart tags step-by-step in Add-in Express documentation. The sample smart tag is written in Visual Basic .NET (VS 2005). See also Add-in Express flash video about building smart tags for Excel and Word.
Available downloads:
Sample for VS 2005

How to show a custom form when installing and registering a COM add-in via ClickOnce

This Visual VB.NET solution for VS 2005 demonstrates how to show a custom form (WinForm) when you install your Office add-in via ClickOnce. Add-in Express supports the ClickOnce technology for Office 2000 - 2007 add-ins.
Available downloads:
Sample for VS 2005

Internet Explorer

How to create an add-on for Internet Explorer in Visual Studio 2005

You can see this Visual Basic .NET solution for VS 2005 as Add-in Express for Internet Explorer flash video. You will learn how you can use Add-in Express for Internet Explorer to create a custom IE toolbar, custom Internet Explorer Bar, IE menu item / command, and a custom context menu item.

Available downloads:
Sample for VS 2005

Download Manager sample add-on for IE

This is a sample add-on for Internet Explorer which demonstrates how to implement Drag-and-Drop and download files in IE6 and IE7. The sample is written in VB.NET (VS 2005).
Available downloads:
Sample for VS 2005

How to show WPF controls in IE bar?

A sample add-on for Internet Explorer 6 and 7 demonstrates how to use WPF controls on an IE bar. The sample is written in VB.NET (VS 2008).
Available downloads:
Sample for VS 2008

Have any questions? Ask us right now!