C# 字互操作
我有一个应用程序,需要能够打印现有的 Word 2007 格式文档。
环顾四周,我找不到任何无需安装 Word 即可实现此目的的免费组件。有谁知道吗?
假设我必须安装 Word 才能打印 docx 文件,我将使用 COM 互操作程序集。一些最终用户将安装Word 2010,一些将安装Word 2007,一些可能会使用安装了兼容包的Word 2003,以便他们可以查看docx 文件。
2a。如何确定要引用和部署的 COM 互操作版本?
I have an application in which I need to be able to print an existing Word 2007 format document.
Looking around I can't see any free components that will facilitate this without the need for Word to be installed. Does anyone know of any?
Assuming that I have to have Word installed to print the docx file, I was going to use the COM interop assembly. Some of the end users will have Word 2010 installed, some will have Word 2007 installed and some may be using Word 2003 with the compatibility pack installed so that they can view docx files.
2a. How can I determine which version of the COM interop to reference and deploy?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Microsoft.Office.Interop.Word
应该与 2007 和 2003 兼容。要检查已安装的 Office 版本,您可以执行以下操作:
Microsoft.Office.Interop.Word
should be compatiable with 2007 and 2003.To check the installed office version though you can do:
另一种选择是使用 OpenOffice 或 LibreOffice。
当我拒绝使用其他 Office 许可证时,我就使用它们来实现自动化。他们还可以将 Word 格式转换为 PDF。
便携式 版本也相当不错——您不必担心安装问题。
Another option is to use OpenOffice or LibreOffice.
I've used them for automation when I had pushback on using another Office license. They can also convert Word formats to PDF.
The portable versions are also quite nice -- you don't have to worry about installs.