开发者

Installing Microsoft Office 2007 on a Server Core Machine

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 Windo开发者_开发问答ws 2008 R2 Server Core Machine?


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.


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/.


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


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".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜