tags:

views:

23

answers:

3

Our office is running two different versions of MS Office (2007 and 2010). Is there a way for me to integrate Outlook into a C# project and have it work for both versions of Outlook? I have added a reference to Microsoft Outlook 14.0 Object Library, but for users of Outlook 2007, do they require version 12.0 or will the newer version work?

A: 

You can use the 2007 (v12.0) library, and it should work fine with whichever version is installed on the user's machine.

SLaks
+1  A: 

You should be able to use the primary interop assemblies. Binding redirects are put in place so when you load an application that accesses the primary interop assemblies for 12.0 on a machine that has 14.0 installed, the 14.0 versions will be loaded. This should allow you to develop the same code and have it work for both 2007 and 2010

Matthew Abbott
+1  A: 

Hi,

I've faced a similar problem recently. The software would either work with 2007 or 2010. I fixed this by referencing the 2007 libraries (v12.0 as Slaks suggested) and in the properties of the reference I set "SpecificVersion" to false.

After that it worked fine with 2007 and 2010

TimothyP