home | get the code | forums | share code | registration

More Outlook Resource Sites

Microsoft Developer Network (MSDN)

FAQs and other general resources

Outlook Developer News

Integrating .NET controls in a folder home page

A folder home page (or FHP) is a web page displayed in an Explorer window in Outlook. A simple FHP might include an Outlook View Control (OVC) instance to show the folder contents, plus other controls to add functionality, such as filtering the view to show only items related to the current user. Two samples are available for more complex implementations using managed code controls.

In the article Outlook Folder Homepage: Hosting WPF, ActiveX and Windows Forms controls, Hülya Pamukçu describes how to incorporate Windows Presentation Foundation controls into an FHP, including a control that wraps an OVC. A complete code sample is available.

An earlier MSDN article, Outlook Customization for Integrating with Enterprise Applications, describes a CRM application that wraps an OVC in a managed code control and hosts it in an FHP. The accompanying sample is written for VSTO 2005, not VSTO 2005 SE or VS 2008, so you won't be able to load the project directly. You should, however, be able to start a new Outlook VSTO add-in project and add the code files from the CRM project to see how it works.

New tools for VSTO developers

Microsoft has released some unsupported, but handy free tools for Visual Studio Tools for Office developers. Of particular interest to Outlook programmers will be the Office Custom UI Manager for coordinating multiple Ribbon, task pane, and form region instances, the VSTO Troubleshooter to help with deployment prerequisites, and, especially for C# developers, the Office Interop API Extensions to handle parameterized and optional properties. See:

More VSTO add-in samples for Outlook 2007

The Office Developers Conference and the release of Visual Studio 2008 have brought a flurry of interest in building add-ins for Outlook using the Visual Studio 2008 platform. Here are some of the sample add-ins and walkthroughs that people have posted recently:

Context menus for sender and recipients

Among the six context menus that Outlook 2007 supports for developers, you won't find the menu that appears when you right-click the sender of a message or one of the recipients. So, I take my hat off to Mac on the microsoft.public.outlook.program_addins newsgroup for pointing out this article:

The secret is that the Additional Actions submenu is populated with the smart tags that are registered for Outlook!

You still can't add items to the main recipient context menu, only to the Additional Actions menu. Access to the main recipient context menu is on my wish list for Outlook 14.

Hotfix for Item.Close problem in Outlook 2003 and other issues

Microsoft has issued a post-SP3 hotfix for Outlook 2003 that should resolve these issues, among others:

  • You apply security update 924085 (MS07-003) for Outlook 2003. You close an Outlook item that uses the Item.Close() event. If the currently closed item is discarded by making a call to the Item.Close olDiscard method, you receive an error message.
  • When you run a macro that retrieves the date of searched Outlook items, the date may be converted incorrectly according to the current time zone.
  • You view a Web page that uses the Outlook View control in your Web browser. If you change an item that is opened in the Outlook View control, Outlook may close unexpectedly.

For more information and for the link to request the hotfix, see:

From the Forums

Basic Outlook Techniques
VBA Code to suppress/eliminate outlook security...
The warning message is 'A program is trying to access email address.....". I use the following code OlSecurityManager.DisableOOMWarnings = True But it shows error. How to declare OlSecurityManager? Anyone please help me.
Outlook View Controller and IE7
I have OVC working like I want it to in IE7. I'm loading the initial view I want using onpageload script. I'm switching views, I'm launching new items. The page is running on my local machine (which it will when the solution is complete: it's sales-force...
Outlook Form Design
Reading Outlook Custom Form Field Contents...
Hello, we use Outlook forms that contain custom fields. The last recipient in the workflow of the forms shall now have an application that reads the custom fields and adds them to a record in the company SQL Server. I developed a routine in Microsoft...
Task Tracking
I assign tasks to 6 people in my department, 3 are programmers, 2 are testers and 1 is a document writer. A particular task may go from a programmer to a tester and back-and-forth a few times. Eventually the task goes to the document writer. Currently...
Outlook Expert Techniques
Calendar Invite template
i have created a meeting invite template that i wish to send out but the appointment needs to go into another mailbox's calendar that i have attached to my mail profile, at the moment when i send the invite out, the meeting will appear in my calendar...
Moving mail back to original folder
In our add-in,we are giving user facility to move mails to a folder.Now,this folder would be in primary storage,.pst,but mail could be in a different .pst.Now,we want user to be able to move the mail back to inbox folder of the secondary storage.How can...
Outlook and .NET
current email account
hi how Can i know a e-mail of the current user account in outlook?
CommandBarPopup does not appear when it should...
Hi everyone, I have done a drop down menu using CommandBarPopup button Share Add-in with C#, and it was ok, I have repeated the same steps in other one and it does not appear anything. I would like to show the information of my contact in this new...
Code Essentials
Storing an Outlook Folder Location
Hello, In my quest to build a email message parsing tool, I can manually VBA code the folder location I wish to parse. But I'd rather provide a button on the form to which would result in a folder menu for the user to select where the parsing is to...
How can I loop saved msg files and rename...
Dear all I am trying to create a app that will loop a folder with msg files, and rename them according to a naming standard of: <data><Sender><Subject>.msg

Newest Resources

How Do I: Deploy a VSTO Add-in -- This 15-minute video shows how to modify a setup program to automatically create a Code Access Security policy that will allow the add-in to execute.

Making a Custom Group Appear in the Message Tab of a Mail Item -- Norm Estabrook explains how to make a custom ribbon group appear on both the compose and read Inspector windows.

Communicator add-in for Outlook 2007 -- Outlook 2007 sample add-in, built using VSTO and the Communicator Automation API, to display Communicator contacts in a task pane, with source code.

PickFolderEx -- Custom control for displaying an enhanced version of the Pick Folders dialog with support for selecting multiple folders with or without subfolders, setting the root folder, and setting the default selection. Compatible with Visual Studio, VB 6.0, VBA, and VBScript. Developer license allows redistribution in customer projects.

Back To The Future - Or, Prototyping VSTO Add-ins for Unsupported Office Versions/Applications -- VSTO guru Andrew Whitechapel explains why the add-in model in VSTO 2005 SE and VS 2008 makes it easy to prototype add-ins for Office host applications that are currently unsupported and also to prototype add-ins for future versions of Office.

Displaying form region using Ribbons in Outlook 2007 -- Chris Ongsuco explains how to create a form region with the new VS2008 designer and add a button to the ribbon to create a new item using that form region.

Latest updates for the Outlook 2007 Auxiliary Reference

Outlook Add-in and SharePoint: Getting Started -- Ed Richard uses new Outlook 2007 features to create an add-in for saving messages to SharePoint.

MFCMAPI.exe - February 2008 version -- Updated version of the free MAPI Editor (and viewer); source code available as an excellent Extended MAPI demonstration project.

Querying Outlook and OneNote with LINQ -- Stefan Cruysberghs shows how to use LINQ in .NET 3.5 (Visual Studio 2008) to query Outlook messages, appointments, tasks, contacts, and notes. Includes a very cool example of running a query to get the count of messages sent for each day during the past week.

Catch all events on a folder -- This VSTO 2005 SE code sample (VB.NET) by Thijs Schreijer demonstrates how to supplement the Items.ItemAdd and ItemChange events with a timer-based event to work around the limitations that prevent the Items events from catching all new and changed items.

RibbonX: Customizing the Office 2007 Ribbon -- Book by Robert Martin, Ken Puls, and Teresa Henning on using the new Office 2007 ribbon UI. Code focuses on VBA, which doesn't apply to Outlook, but still a useful overview of ribbon concepts.

Inspector wrapper w/ Wordmail VSTO 2005 vb.net -- Supports messages and posts that use Word as the email editor

All Outlook object model calls run on the main thread -- Wes Haggard explains why trying to run Outlook code on a background thread may result in worse performance.

Convert recorded message body macros to Outlook 2007 -- Sue Mosher explains how to use a macro recorded in Word to insert text into an Outlook 2007 message or other item body.

Login

login
password
Remember me

You will need to register and log in if you want to download the source code for the Microsoft Outlook Programming book. The forums and code sharing areas are open to both registered and non-registered visitors.

Hot Code Samples

Beginner
Save and remove attachments from email items...
Sending a mail message with today's appointments...
Add appointment to other user's Calendar
Intermediate
C# AddIn sample: InspectorWrapper & CommandBar...
Import Appointments FROM Excel
Launch custom form message with default signature...
Advanced
Set color label on appointment
CommandBar & ExplorerWrapper c# example
Insert user signature with VBA

OutlookCode RSS Feeds

All OutlookCode.com content

Outlook developer news

New Outlook developer resources

OutlookCode.com forums

OutlookCode.com code samples

OutlookCode.com articles