views:

60

answers:

2

We have a program made in Borland Delphi that uses Word automation to create documents. On an installation (terminal server) we are only able to get the Word automation to work when running as local administrator.
When runnnig as anoter user we get an error message "Opdracht mislukt -2146824090" (its dutch version of Office), wich I guess is translated to "Operation failed" or "Command failed".

The user has read/write access to the folder where the program try to put the new document.

Office 2010
64bits Windows server 2008 R2 standard

The applicaion is 32bit windows application.

If I add a delay (500ms) after the word.application is created, everything works as normall.

WordApp   := CreateOleObject('Word.Application');
sleep(500);
Doc := WordApp.documents.Open(sFile,EmptyParam,true);

Anybody knows why the CreateOleObject command now returns before the Word application can be used?

+1  A: 

If you want to track out that, you could use a tool like ProcessMonitor to trace the Word automation executions till the point which you can use the app.

Seems some kind of rights check is taking place - but half a second seems too much time just for this.

Fabricio Araujo
The rason it works with the local administrator account, seems to be that Word starts twice as fast with this account. Not sure why dough
Mike
A: 

The administrator account working wihtout delay, seems not to have anything with rights to do, but that Word happens to start much faster with this account than the normal domain user accounts.

I can live with the delay workaround, but if anyone knows a better way please let me know.

Mike