.Net, MS Office, Outlook, Outlook 2007, VSTO

VSTO .NET4 Outlook 2007 Add-in: Referencing Form Regions Programmatically

In this article I intend to further expand on my series of articles covering VSTO development of MS Outlook Add-in components using Visual Studio 2010. In previous articles I have covered things such as adding custom actions to archive email messages via the Application_ItemSend event, as well as adding custom code to save Outlook email messages to a database in the .MSG format.

I will review how to integrate a custom form with events in the Outlook Add-in component. However, I won’t review the GUI aspects of custom form development in Visual Studio since this primarily involves stepping through Wizards and drag and dropping controls to the form UI in Visual Studio. I will assume this is fairly self explanatory and has been covered in depth by Microsoft on it’s support Web site.

Continue reading “VSTO .NET4 Outlook 2007 Add-in: Referencing Form Regions Programmatically”

.Net, MS Office, Outlook, Outlook 2007, Programming, Software, VSTO

.NET Save Outlook Email to Database as Byte Array

In a previous article I wrote about how to create a custom add-on for Outlook that will archive emails based on a keyword in the Email’s subject line. I will expand on this concept to show how to convert the sent email from an Interop.Outlook.MailItem COM object to a save-able .MSG email message. The ultimate goal of this is to convert the sent email into a format that can be saved to a database table as a VarBinary datatype.

Background Info: Why Convert the Email to .MSG Format?

Using the Application_ItemSend method of a Visual Studio 2010 Outlook Add-in project, one can capture the Email message being sent using the Outlook.MailItem object. Although in theory it would make sense that one could directly convert this object to a Byte array to be saved in a database table, this is in fact not a viable option. The Outlook.MailItem object is in fact a COM object that cannot be dynamically saved/loaded. To achieve the desired save/load functionality the Outlook.MailItem object will first need to be converted to a .MSG file.

Continue reading “.NET Save Outlook Email to Database as Byte Array”

.Net, ASP.NET, Deployment, MS Office, Outlook, Outlook 2007, Programming, VB.NET, VSTO

Outlook Custom Add-In to Archive Emails on Send Based on Keyword in Subject Line (Visual Studio 2010)


The great thing about the Microsoft technology stack is that things tend to work together without the need to download and install unfamiliar libraries from unknown sources.  I continue to be impressed by how Microsoft centralizes its code libraries with Visual Studio and .NET 4 to make most development tasks quite seamless.

For example I am working on an add-on component for MS Outlook 2007 that will help people archive their sent emails by including a keyword in the subject line of their email.

Visual Studio has default project templates for Office, including templates for Outlook 2007 and Outlook 2010. Happily enough, the code required to interface with Outlook is auto-generated behind the scenes and the programmer simply has to worry about writing the actual logic of the component. This is a big step forward from how things used to be!

Another big plus for my development efforts is the set-up and deployment project template that Microsoft has included with Visual Studio. Once my Outlook component has been fully coded I can simply create a Deployment project to send out to users. That way a user can install my component simply by clicking the ‘Next’ button on an installer wizard.

Continue reading “Outlook Custom Add-In to Archive Emails on Send Based on Keyword in Subject Line (Visual Studio 2010)”