C# Visual Studio: How to have multiple developers on a solution that references Office?

僤鯓⒐⒋嵵緔 提交于 2019-12-04 15:43:20

Abstract your code so that ALL of the code that touches Office is in a separate project. Then you can have two projects - one for Office 11 and one for Office 12. Then reference both projects from your application. If the classes both implement a common interface, then you can use a factory pattern to instantiate the appropriate one and use the features without having to recompile.

You might be able to use late binding for this.

Have a look here: http://www.hanselman.com/blog/BackToBasicsVarDim.aspx

or here: http://support.microsoft.com/kb/302902

late bind to whichever type library is present, and code against the older interfaces - if youre using the v11 interfaces, you should be ok when you ve got v12 on a machine.

If you abstract the interface to a separate project you can then then use vb.net and its built in late binding support to provide the functionality and manage resources.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!