开发者

check for existence of office.interop assemblies

开发者 https://www.devze.com 2023-02-17 14:43 出处:网络
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

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开发者_如何学Python 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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消