在服务器核心计算机上安装 Microsoft Office 2007
我有一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
作为服务运行时(包括如 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.
我建议您使用 打开 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 资源工具包了解部署选项。一些注意事项:
.Visible = True
的 Word 命令。这将导致失败。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:
.Visible = True
. It will result in failure.请注意 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".