Office 2003 PIA's used in a Windows Service

M

Mike Jones

I'm trying to use the Word 2003 PIA's in a .net windows service application.
The code works perfectly in a windows form application, but in the Windows
Service the code seems to hang when creating an instance of the Word
Application object and never returns.

Word.Application wordApp = new Word.ApplicationClass();

Any ideas on this?

thanks,

Mike Jones
 
P

Peter Huang [MSFT]

Hi

Word and other Office Application is designed for Desktop Usage. For server
side automation is not supported.
INFO: Considerations for Server-Side Automation of Office (257757)
http://support.microsoft.com/default.aspx?scid=KB;EN-US;257757

Also Windows Service is running in another desktop, usually it will not
have any UI interactive, if you try to open a window in windows service, it
will not show in the currect desktop, that is to say, you will not see it.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Gary McGill

Notwithstanding Peter's statement that running Office in a service is not
supported, it can be done.

It's probably a message box popping up and waiting for input. Go to the
service control manager, open the properties for the service, and on the Log
On tab, check "allow service to interact with desktop", then re-start your
service. That way you'll see the dialog box. (I assume you're running XP).

Gary McGill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top