This sample application was built in Visual Studio 2003 using version 1.1 of the framework.

As we are dealing with Outlook, we have a reliance on the Primary InterOp Assemblies (PIA) for 2002 and 2003.  Outlook 2000 does not have a PIA, so an InterOp Assembly has been generated and is included in the 'Outlook 2000 InterOp Assemblies' subfolder.

If you are using Outlook 2003, the PIAs are on the Office CD/DVD and also come with Visual Studio 2003.
If you are using Outlook 2002, you will need to download the PIAs from http://www.microsoft.com/downloads/details.aspx?familyid=C41BD61E-3060-4F71-A6B4-01FEBA508E52&displaylang=en

You may find that you need to check the references to Microsoft.Office.Core and Outlook.  If you have the yellow warning triangle or a build error, you can remove both these references, and
then add them again on your system (right click on References, select Add Reference, change to the COM tab, scroll down and select the appropriate outlook library, i.e. for the Outlook2002 assembly, the reference should be: 'Microsoft Outlook 10.0 Object Library', and for the Outlook 2003 assembly: 'Microsoft Office Outlook 11.0 Object Library'.

If you do not want to bother with building the application for all 3 versions of Outlook, simply exclude the projects you don't want (Build->Configuration Manager).  This will save you having to install both versions of the PIAs.

The PIAs for Outlook 2002 and 2003 can coexist, and should allow you to develop applications for both of these versions of Outlook even though you can only have one version of Outlook installed.

However, for both PIAs to appear in the COM assembly list, both the type libraries to which they refer are required on the development system.  As only one version of outlook can be installed, this means you will need to manually copy and register 'the other' version type library.

For example, if you had Outlook 2002 with its PIAs installed, and then upgraded to Outlook 2003, the 2002 PIAs will still be in the global assembly cache (GAC)...but you will no longer see it listed in the COM list as the type library to which it refers has been removed during the upgrade.

Most users should be able to simply copy and register the 2002 type library, and then find both COM versions available in the list.  

However, myself and a few other developers found this didn't work on our systems....i.e. there was only ever one entry in the COM list, and that was the 2003 version....and as there was no way to override the automatic mapping that visual studio performs between a type library and the PIA, this caused a problem that required a registry modification.  Looking in the registry, the following two entries should exist (and did on my problem system)...However, looking at the values, both these entries were pointing to the 2003 PIA, rather than 9.1 pointing to the 2002 PIA.

OL XP:
HKEY_CLASSES_ROOT\TypeLib\{00062FFF-0000-0000-C000-000000000046}\9.1

OL 2003:
HKEY_CLASSES_ROOT\TypeLib\{00062FFF-0000-0000-C000-000000000046}\9.2

When I changed the 9.1 to point to the correct PIA, I was then able to add a reference to the 2002 type library, and have the system correctly map this to the 2002 PIA. 


Some good sources of Outlook information on the PIAs, etc. are:-

http://www.microeye.com/resources/res_tech_vsnet.htm
http://www.slipstick.com/

If you want more information on Redemption to get around those security warnings:

http://www.dimastr.com/redemption/