D
D
Diamond2016-08-24 09:12:16
IIS
Diamond, 2016-08-24 09:12:16

How to work with word?

There is a NetSchool web application in which, when improvements were made, but it was time to update this application, everything went well until it came to exporting files to word. It uses Word.Application, and here is a piece of code:

Set Wrd = Server.CreateObject("Word.Application")
  Wrd.DisplayAlerts = False
  Wrd.Application.Options.Pagination = False
  Wrd.Application.ScreenUpdating = False
  Response.Write IsObject(Wrd)

The last line returns "False", which actually means everything is bad.
Everything was moved to a clean, test server. From here there will be questions:
It is necessary to install office 2003? Installed, no change.
Do I need to somehow connect the office.interop.word library? How? I don't have a project in visual studio. The application is on win srv 2008r2, iis 7.
Found a solution:
1. Windows "Start | Run | dcomcnfg" to start DCOM configuration.
2. Go to "Component Services | Computers | My Computer | DCOM Config",
right-click "Microsoft Word 97 - 2003 Document" and select "Properties".
3. Go to "Identity" tab page, among the three radio buttons "The interactive user",
"The launching user" and "This user", select the last one, and put in the user
who installed Office onto this server/PC . This is one of the tricks otherwise
you will get errors once the backend code (such as ASP.NET) tries to invoke
the Word DCOM component while this user is not logged in.
you installed Office and you are always logged in when you test.
4. Go to the "Security" Tab, on the "Launch and Activation Permissions" group box,
add the identity which runs your website - the one you found out earlier - something
like "NETWORK SERVCIE", and allow local launch and activation. Some link also
mentioned adding "IUSR_".

It did not help, I decided to reinstall office, now there is no "Microsoft Word 97 - 2003 Document" in DCOM
Installed:
  • Office Professional Edition 2003
  • Office 2003 web components
  • Office 2010 PIA
  • Office Enterprise 2007
UPD I already ran out of ideas, what could be the problem? Maybe it's worth rewriting on other libraries?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question