在服务器核心计算机上安装 Microsoft Office 2007

发布于 2024-09-24 17:54:23 字数 142 浏览 2 评论 0原文

我有一个 Windows 服务(当前在 Windows 2003 Server 下运行)需要使用自动化与一些 Word 文档进行交互。该服务需要移至新服务器。

是否可以在Windows 2008 R2 Server Core机器上安装和调用word文档?

I have a windows service (currently running under Windows 2003 Server) that needs to interact with a few word documents using automation. This Service needs to move to a new server.

Is it possible to install and invoke word documents in a Windows 2008 R2 Server Core Machine?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(4

稚然 2024-10-01 17:54:23

作为服务运行时(包括如 ASP.NET)。它是一个桌面客户端应用程序,具有用于自动化该应用程序的 API,而不是 Word 子系统的 API。

可能尝试查看Word Automation Services ,但请注意,这是一个 SharePoint Server 2010 组件。

我强烈建议您寻找替代方案,例如用于编写 Word 文档或其他文件格式的各种工具(有些是免费的,有些不是)。

这似乎没有实际意义,但我怀疑Word能否在服务器核心上运行。它针对范围内的服务器使用进行了大量精简,并且将缺少桌面客户端应用程序想要使用的许多东西。

Regular Word automation is not supported when running as a service (including things like ASP.NET). It is a desktop client application with an API to automate that application, not an API to the Word subsystem.

You might try looking at Word Automation Services, but note that this is a SharePoint Server 2010 component.

I would strongly recommend looking at alternatives, such as the various tools (some free, some not) for writing Word documents, or other file formats.

It seems moot, but I also doubt that Word will work on server-core. It is heavily stripped down for scoped server usage, and will be missing many things that a desktop client application will want to use.

两仪 2024-10-01 17:54:23

我建议您使用 打开 Microsoft Office 的 XML SDK 2.0。在 Office 开发人员门户中的 XML 上,"如何:使用 Open XML SDK 2.0 进行文字处理" 和 http://openxmldeveloper.org/ 您会发现很多如何使用 Open XML SDK 2.0 的示例。

Open XML SDK 2.0是专门针对服务器使用的技术。您根本不需要在服务器上安装Office,就可以在服务器上读取、修改等Office文档。一开始从 Word 自动化切换到 Open XML SDK 似乎很困难,但我确实建议您花一点时间来研究该技术。很快你就会很幸运地在服务器上使用它。您还可以在 codeplex.com 上找到一些有趣的代码示例和实用程序(只需搜索“Open XML”)。例如,请查看 http://openxmldemos.codeplex.com/ 中的演示 04。

I would you recommend to use Open XML SDK 2.0 for Microsoft Office. On XML in Office Developer Portal, "How to: Word Processing with respect of Open XML SDK 2.0" and http://openxmldeveloper.org/ you will find a lot of example how to use Open XML SDK 2.0.

Open XML SDK 2.0 is technology special for the usage on the server. You don't need to install Office on the server at all and will be read, modify etc. office documents on the server. At the beginning the switching from Word automation to Open XML SDK seems difficult, but I do recommend you invest a little time to study the technique. In a short time you will be lucky to use it on the server. Some interesting code examples and utilities you will also find of the codeplex.com (just search for "Open XML"). For example look at Demo 04 from http://openxmldemos.codeplex.com/.

是的,只需使用静默安装即可在 Server Core 机箱上获取 Office 2007 - 请参阅 TechNet 的 Office 资源工具包了解部署选项。一些注意事项:

  1. 唯一不直接支持服务器核心安装的 Office 组件是 Project Server 和 SharePoint Server。他们甚至不会安装。
  2. 您无法调用任何需要客户端应用程序 .Visible = True 的 Word 命令。这将导致失败。
  3. 使用 PowerShell 自动化 Word 可能是使用 Server Core 和 Office 的最简单方法。对于某些 COM 功能,您可能需要创建 .NET 包装器,而不是直接从 PS 调用(最值得注意的是 WordBasic 调用)。
  4. 之前已经说过不要在服务器上进行办公自动化 - 但这不是您需要的建议。因此,请务必阅读以下内容:Office 服务器端自动化的注意事项

Yes, just use a silent install to get Office 2007 on your Server Core box - refer to TechNet's Office Resource Kit for deployment options. A couple of notes:

  1. The only Office components documented that are not supported directly for Server Core installations are Project Server and SharePoint Server. They won't even install.
  2. You cannot invoke any Word command that requires the client app to .Visible = True. It will result in failure.
  3. Using PowerShell to automate Word is probably the easiest way work with Server Core and Office. With some COM features, you may need to create a .NET wrapper instead of calling from PS directly (most notatably WordBasic calls).
  4. It's all been said before about not doing on Office Automation on the server - but that's not the advice you need. So, make sure you read this: Considerations for server-side Automation of Office
只有影子陪我不离不弃 2024-10-01 17:54:23

请注意 Marcs 关于它不受支持的警告(以及 Oleg 提供的替代方案)。

由于办公自动化(至少听起来像您使用它的方式)基本上会调用该程序(您在任务管理器中看到它),但将可见性设置为 false 时,它​​将无法在 Server Core 上运行。您必须能够安装和运行 Office(在核心上无法安装和运行 Office)。

http://technet.microsoft.com/en-us/library/dd184076.aspx
“您也不能使用它来运行 Microsoft Office System 应用程序或 Microsoft Office SharePoint Server。并且您不能(或至少不应该)使用它来运行您内部开发的自定义应用程序”。

Pay attention to Marcs warning about it not being supported (and the alternatives provided by Oleg).

Since office automation (at least the way it sounds like you are using it) basically invokes the program (you see it in the task mgr) but with visibility set to false it will NOT work on Server Core. You would have to be able to install and run office (which you can't on core).

http://technet.microsoft.com/en-us/library/dd184076.aspx
"You also can't use it for running Microsoft Office System applications or Microsoft Office SharePoint Server. And you can't (or at least shouldn't) use it to run custom applications you've developed in-house".

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