tags:

views:

24

answers:

1

In Win7, I am running a service which launches a process which hosts the office-library (Word 2007) for the purpose doing a mail-merge. There is no interface anywhere. When I launch the mail-merge process with the service as the parent, Word cannot create a document using my existing mail-merge Word doc. At first I thought the problem was with UAC so I changed the manifest to run as admin but it seems like that was irrelevant. When I launch the process from explorer or a non-service process instead of the service it works and is able to load Word and a document successfully. I used Process Monitor to see if I could get some clues as to what could be happening. As far as I can tell, when the proc is launched by the service it is using system profile since I see file paths such as c:\windows\system32\config\systemprofile and c:windows\temp instead of my user profile folders C:\Users\UserName\AppData\Roaming\Application\ etc. My service is running as my username and not localsystem. I check the username using WindowsIdentity.GetCurrent().Name and I get my correct username regardless of service/non-service invocation. I tried changing the Word startup path in the Application object but again it only succeeds in non-service mode. I tried creating the process from the service in both shell mode and non-shell mode and they both behave similarly. I think the problem could lie in the fact that when the proc is launched by the service the user belongs to NT Authority/Service but when launched any other way it is NT Authority/Interactive.

Any help would be greatly appreciated, thanks.

A: 

I was able so solve the problem using the following link for anyone interested: http://social.msdn.microsoft.com/Forums/en-US/winserver2008appcompatabilityandcertification/thread/c19b985f-dd44-404a-ab20-ec3aa193fadd