C# 字互操作

发布于 2024-09-28 17:18:09 字数 280 浏览 1 评论 0原文

我有一个应用程序,需要能够打印现有的 Word 2007 格式文档。

  1. 环顾四周,我找不到任何无需安装 Word 即可实现此目的的免费组件。有谁知道吗?

  2. 假设我必须安装 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.

  1. 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?

  2. 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

等风来 2024-10-05 17:18:09

Microsoft.Office.Interop.Word 应该与 2007 和 2003 兼容。

要检查已安装的 Office 版本,您可以执行以下操作:

new Microsoft.Office.Interop.Word.Application().Version

Microsoft.Office.Interop.Word should be compatiable with 2007 and 2003.

To check the installed office version though you can do:

new Microsoft.Office.Interop.Word.Application().Version
自由如风 2024-10-05 17:18:09

另一种选择是使用 OpenOfficeLibreOffice

当我拒绝使用其他 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文