微软Office开发人员能够通过COM自动化来很好地控制Office中的任何东西,对此他们已经夸耀很久了。由于现存大量由VBA编写的从简单到复杂的应用程序,很多公司甚至都不会考虑去尝试一下OpenOffice的开发。
但不被很多人所知的是,OpenOffice开发人员现在也可以露几手了。OpenOffice开发的基础是UNO组件技术。类似COM,它被设计用于进程内和跨平台开发。它甚至还有一些超过COM的优点。例如,在新API中为粘结代码提供了异常处理和约定的支持。
和COM一样,UNO支持广泛的编程语言,如C++、Java、Delphi、Perl,甚至.NET和Mono。虽然它移植到Mono已经很久,但进行设置通常需要花费太多的精力。
最近Michael Hutchinson为MonoDevelop添加了开发OpenOffice的支持。只需简单地使用MonoDevelop中的插件管理器(Add-in manager)来下载OpenOffice自动化示例(Automation Samples),就可以获得需要的模板。Miguel de Icaza发的一个帖子包含了详细的介绍和一些截图。
Activate the Add-in Manager
Select Templates.
Select the OpenOffice Automation Samples
Complete the installation for the Mono.Addin, once you are done, create a new Solution:
You can skip this step, and get back here later, but you might want to select "Unix integration":
Take advantage of code-completion:
This is what the default sample looks like, you can use this as a foundation for your program. Since this is a COM-based API, it is not an API that is easy to discover with code-completion popups, so we figured it was best to ship full working samples:
Build and run your application by hitting F5:
Your OpenOffice solution in all of its glory, this is from the samples that we distribute as part of the templates:
声明:LUPA开源社区刊登此文只为传递信息,并不表示赞同或者反对。

迷你博客
日志
相册
群组
分享
电影
问答
停车游戏
奴隶游戏
开源大搜索
项目点评
礼品中心
职业评测
开源博客
新闻阅读
考试练习
LW3DK开发
开源论坛
下载频道











