Reputation: 3111
I'm using Office Primary Interop Assemblies to control PowerPoint from my WPF app. Currently I'm using PIA v14 in my project and it works with both Office 2010 and Office 2013 without problems. But I need to add support also for Office 2007 (when I tested my app on computer with Office 2007, it didn't work).
So, my question is: Should I change my referenced PIA in project to the v12 (to support Office 2007/2010/2013) or it is possible to add both v12 and v14 (maybe also v15) PIAs to the project and dynamically loads correct version of assemblies during app start based on Office version installed on target computer? Also, is there some compatibility risks, if I will use PIA v12 on all Office versions (2007/2010/2013)?
Upvotes: 1
Views: 1696
Reputation: 8902
There is a simple solution for this, Use one of the Office Interop wrapper assemblies. These wrapper amssemblies use late binding to support the feature of specific version of Office. I have used NetOffice and I would recommend you to use this.
Features provided by NetOffice
Upvotes: 5