简体   繁体   中英

Word Automation using microsoft word interop for a web application without an Interactive User

I am aware that Microsoft does not recommend using word automation on server side ( link to considerations for server-side Automation of Office ).

Still I see some advantages of using word automation such as the ability to use a template and allow my client to change it (the plain text) with no need to change any coding.

My problem: I couldn't find a way to execute the word automation function when there is no interactive user (I am using a virtual dedicated server and I have to use remote connection). If I don't connect to the server the word automation doesn't work.

I read what I could find on this topic, and I would like to share the way I managed to sort this problem out.

this solution applies when the Word Automation works when there is an interactive user. the steps hereunder are to change from interactive user to a specific user so there is not obligation to be connected to the server to allow the word automation to work.

  1. I created a new User on the server set a password and give it Administrator privileges.
  2. Click Start, click Run, and then type DCOMCNFG.
  3. in Component Services->Computers->My Computer ->DCOM config ==> right click Microsoft Word 97-2003. select Properties.
  4. in Security tab go to Edit and Add the user you created.
  5. in Identity select "This user" put the user you created and password.

I hope some of you will find it helpful.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM