仅安装 Office 2010 的 Office 2003 互操作
我们有一个使用 Outlook 2003 功能(Microsoft Office 11.0 对象库)的应用程序 (.NET 2.0)。我的新计算机安装了 Windows 7 和 Office 2010,并且引用不再起作用(只有 Office 14 对象库可用)。
有没有办法在安装Office 2010时使用Office 2003 dll(我听说2003和2010不能安装在同一台机器上)?我尝试为 Office 2003 安装“可再发行主互操作程序集”,但如果没有安装 Office 2003,则无法执行此操作。
We have an application (.NET 2.0) that uses Outlook 2003 features (Microsoft Office 11.0 Object Library). My new computer has Windows 7 and Office 2010 installed, and the references don't work anymore (there's only Office 14 Object Library available).
Is there any way to use Office 2003 dlls when Office 2010 is installed (I've heard that 2003 and 2010 cannot be installed on the same machine)? I've tried to install the "Redistributable Primary Interop Assemblies" for Office 2003, but couldn't do it without installed Office 2003.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用后期绑定,而不是引用特定版本的库。这样您就可以针对一个版本进行开发,但只要您坚持使用通用功能,它也可以在其他版本中使用。
本文解释了差异 使用 Visual C# .NET 绑定 Office 自动化服务器
它可以更容易做到使用早期绑定进行开发,以便您获得 Intellisense,然后稍后删除引用(这将需要一些时间。是否值得,这在一定程度上取决于您的 Office 开发技能水平。
Rather that referencing a specific version of the libraries, use late binding. That way you can develop against one version, but as long as you stick to using common functionality it'll work in other versions as well.
This article explains the difference Binding for Office automation servers with Visual C# .NET
It can be easier to do the development using early binding so that you get Intellisense and then removing the references later on (which will take a little time. If it's worth itdepends a bit on your skill level with Office development.
我怀疑 kor_ 是否仍然遇到这个问题,但我很难找到有关此问题的帮助。
我遇到了类似的问题,经过多次搜索后找到了 NetOffice。它是 COM 对象的包装器,因此您无需更改代码即可获得后期绑定兼容性。
我相信PIA仍然需要用户与office一起安装。
http://netoffice.codeplex.com/
I doubt kor_ is still having this issue, but I had a hard time finding help on this one.
I was having a similar issue and found NetOffice after much searching. It's a wrapper for the COM object so that you can get late-binding compatibility without having to change your code.
I believe the PIAs still need to be installed by the user along with office.
http://netoffice.codeplex.com/
通过后期绑定,您可以删除对 Office Interop dll 的任何引用。
我们和你有同样的问题,这有效:
With late binding you can remove any reference to Office Interop dll's.
We have the same issue as you and this works: