假设我正在使用 SharpDevelop/VS 开发一个使用 PowerPoint 的应用程序。
我是否需要重新编译应用程序以便为每个版本的 MS Office 构建一个版本?
我有 MS Office 2007,但我还希望该应用程序可以与 Office 2003 及更高版本一起使用,而无需为每个版本重新编译该应用程序。
我是否只需要在客户端计算机上安装适当的 Office Interop 可再发行包/msi,然后按原样发布我的应用程序?
在此先感谢您的帮助。
假设我正在使用 SharpDevelop/VS 开发一个使用 PowerPoint 的应用程序。
我是否需要重新编译应用程序以便为每个版本的 MS Office 构建一个版本?
我有 MS Office 2007,但我还希望该应用程序可以与 Office 2003 及更高版本一起使用,而无需为每个版本重新编译该应用程序。
我是否只需要在客户端计算机上安装适当的 Office Interop 可再发行包/msi,然后按原样发布我的应用程序?
在此先感谢您的帮助。
I absolutely agree with Nifle. Use the OLDEST ones you can find. If you use 2007, there is a very good chance it will not work with older versions.
Since I did not want to install the oldest Office version on my development PC, I used Virtual PC to create a "final build" environment. I develop with my regular PC then move the source files over to the Virtual PC with Office 2003 and VS installed, and create the final customer build there.
You will need to edit the CSPROJ file to reference the older Office libraries with this method. You can do that by just opening VS on the build virtual PC, removing the references to Office and adding them again.
如果您使用的是 Microsoft.Office.Interop 库,您只需要 2007 版本,它将与旧文档向后兼容
我发现您应该针对您拥有的最古老的 MS Office 进行构建。我们仍然使用 MS Office 2000。
这背后的想法:
只是为了与任何尝试这样做的人确认这一点。我有一个引用 15.0 PowerPoint 互操作库和 Office 15.0 库 (Office 2013) 的 .NET 4 项目。我将项目设置为“嵌入互操作类型”。
我安装了一个装有 Office 2007 Ultimate 的虚拟机并运行了该应用程序(没有复制任何额外的 DLL)。它与 PowerPoint 正确交互以提取我的应用程序正在寻找的数据。
根据我的经验,互操作库是向后兼容的。