Joerg

Joerg

  • NA
  • 1
  • 0

Problem starting exe from web application

Aug 16 2006 5:00 AM
Hello,

I am working on a web application that shall be used to record profiles of freelancers in our company.

The site requires a login (FormsAuthentication via SQL-server). Users can input their data into several forms and store it in an SQL-server database.

This all works well.

Now I want to output the stored data into a Word document.

I have designed a Word document using "Microsoft Visual Studio 2005 Tools for Office Systems". It contains a c# routine. This routine retrieves the data from the sql server and puts the data into the word document. Afterwards the document is saved and word closes.

If I run this word document on the server via remote desktop it works well.

But If I try to run the word document from my web application apperantly nothing happens.

I used the following code to call the word document:
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.EnableRaisingEvents = false;
proc.StartInfo.WorkingDirectory = "C:\\Program Files (x86)\\Microsoft Office\\OFFICE11\\";
proc.StartInfo.FileName = "winword.exe";
proc.StartInfo.Arguments = "c:\\inetpub\\www_root\\onlineprofile\\temp\\Profilgrundlage.doc";
proc.Start();

I think there has to be some kind of problem with security or permissions in .net...
I have built a console application with the code above. When I run this console application on the remote desktop, all works well. So the problem cannot be the code itself.

It just does not work, when I try to run it from my web application.

I am thankful for any hints...

Best regards
Wirtz