I’m automating some outlook functionality in a .NET app. It works great. I am compiling it and using v 12.0.0.0 of the Outlook Interop assembly.
My code should work on any version of Outlook so it seems silly to have to bind it to a specific version.
Is it possible to use reflection to do this instead of compiling a reference?
Are the interop assemblies on PC’s by default that have Office installed anyway or do I need to include them with my application?
I remember with COM I used to be able to say something like CreateObject(“Outlook.Application”) without needing a strong reference. I’d like to try something like that here. I suppose I could just use COM without the Interop .NET assembly as a back up plan.
Any advice?
Thanks
It is Microsoft’s burden to keep the COM interfaces compatible. It is required in COM, a published interface can never change. They’ve done an astonishing job over the years, it must have been difficult.
But you’ll have to pick some kind of version of the PIA to target and avoid using interfaces that became available in later editions. It is up to you to find out how far you want to go back, we don’t know what interfaces you use. Download it from MSFT and select it in the Add Reference dialog. Office XP is the earliest, you’d have to generate your own if you want 2000.