Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The short answer is that this isn't supported by Microsoft so don't expect it to work or work reliably.</p> <p>The long answer is that the issue is permissions and how Word works. The link you posted shows how to get around this for Excel but this won't work for Word. The problem is that when Word is called for the first time it wants to display a welcome dialog where the user can enter initials and other stuff. When it's run via IIS, the dialog doesn't show and the COM object can't be created. There are supposed to be some ways to disable this dialog but Microsoft only seems to make them available to volume licenses. Other than that, the way to do it is to try to run Word on the server using the IIS built-in user account and get rid of the first time user dialog that way. </p> <p>Another way I've done this back in the classic ASP days was to use a COM+ object with its own processing space and user permissions. This worked well but I haven't tried it with ASP.NET. This is a good option if your net admin doesn't want to give permissions to the IIS built-in directly.</p> <p>The last solution is to scrap using Word entirely and use a different method to generate your documents. This is the direction I went because memory usage issues between Word and IIS kept causing server crashes during load testing which were unacceptable.</p> <p>Additional Info:</p> <p>As for alternative methods dynamically generating Word docs, you can use a RTF template file. Just create your own tokens in the text where you can do a find/replace on the data fields. Word reads/writes RTF files so you just have to train users sometimes. There are also third party tools available that will create Word docs but they're pricey and I haven't used any of them.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload