I have programmed a Windows Service that open a document in Microsoft Word, and then print it to a Ghostscript PDF printer to create a PDF file.
It works perfectly on Windows 2003 server. But running it on Windows 2008 r2 fails. I am aware of the Desktop folders that need to be created under the system profile, and that solved another problem I had at first.
If I run the service as an application instead, everything works perfect. So it seems that everything is setup and configured correctly.
But when I run it as a Service, I get the following error in my logfile, generated from Microsoft Word:
Error in Microsoft Word: Word cannot print. There is no printer installed.
I have added a printer and manually selected the Ghostscript driver, and also set it as a default printer. So it should work.
When I added the printer I was logged in as an administrator. And it is the same user that runs the Service (it is not the system user). However I have read somewhere that the services still uses the internal users environment in 2008, so maybe that is the problem.