R – Interop with Office 2003 and 2007

interopms-office

I would like to have my application function with both version of Office (as well as Outlook within those). I understand I can't install them full in parallel (Outlook being the fight really).

In specific, our application opens up Outlook, fills some information and loads up the contacts (so they can select who to send it to), and some other basics. If it matters, the OS varies from Windows SP, Server 2003, Server 2008, and Vista.

We're considering going to Office 2007 (going to have to sooner or later whether we like it or not, so I'm preparing sooner rather than later) and if I install Office 2007 I find I can't use the older interop dll (app won't compile). I'm left to assume that if I use the 2007 interop that 2003 won't work — which is what we're on now.

Other apps do this but my Google foo fails me and my StackOverflow foo is about the same.

Any thoughts on how to get Visual Studio to allow me to code for both?

edit:
I actually forgot about this question however I have the answer.

The answer was the cause from something else. The Interop worked just fine however another bit of code referenced another version specific reference (of Excel, to be specific) instead of Interop. Having never worked with Interop before, I just assumed it didn't matter and they were one and the same. Turns out I was wrong. Once we removed all the referenced and re-added back normal Microsoft.Office.Interop references, it all Just Worked (TM).

Best Answer

Err, so the question can close I'll add the answer here:

The answer was the cause from something else. The Interop worked just fine however another bit of code referenced another version specific reference (of Excel, to be specific) instead of Interop. Having never worked with Interop before, I just assumed it didn't matter and they were one and the same. Turns out I was wrong. Once we removed all the referenced and re-added back normal Microsoft.Office.Interop references, it all Just Worked (TM).