I have some code that will run on a server and will generate a word file, to be downloaded to the user. Since it is running on a server, there is no good reason to have the Word application itself visible. The trouble is that I cannot activate Word when I set visible to false.
The code below works fine.
When I comment out the line that says 'mswApp.Vislble = true", I get a COMError that it cannot activate the application.
Any idea why? Why would it let me set the application to invisible if I cannot activate it once I do?
mswApp = new Microsoft.Office.Interop.Word.Application();
mswApp.Visible = false;
// Comment out the next line for production
mswApp.Visible = true;