检查 Office.interop 程序集是否存在
我正在开发 ac# 项目,从 Office 文档获取输入,现在我正在使用 MS Office。这仅仅意味着用户的 PC 上必须存在 MS Office 互操作组件才能正常工作。
不过,我最终也可能将 OpenOffice.org 实现到其中,在这种情况下,我希望我的应用程序能够根据可用的内容自动选择使用哪个程序来处理文件。
是否有任何简单的方法来测试我在项目中所做的某些引用是否在运行该程序的计算机上实际上可用?我真的不想根据 Office 类型发布不同的二进制文件。
I'm working on a c# project where I get input from Office documents, and right now I'm using MS Office for it. This simply means the MS Office interop components have to be present on the user's PC for this to work.
However, I might implement OpenOffice.org into it too eventually, and in that case I want my application to be automatically able to choose which program to use to process files based on what is available.
Is there any simple way to test whether certain references I made in my project are actually available on the computer that is running the program? I really don't want to release different binaries based on Office types.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一个简单的 try catch 块怎么样?
如果系统上不存在该 DLL,则最基本的调用将返回一个有意义的错误。在这种特殊情况下,您可以加载另一个类来处理不同的单词或电子表格处理器
What about a simple try catch block?
If the DLL is not present on the system then the most basic call will return a meaningful error. In that particular case you can load another class that will handle a different word or speadsheet processor