-1

in my asp.net project i want to make modifications in a word document. well every thing is working well in local but i want to know if i can make modifications in a word document in the server or i have to install microsoft office with the web site i mean when i make like this

aDoc = wordApp.Documents.Open(ref filename, ref missing, ref readOnly,
                                    ref missing, ref missing, ref missing,
                                    ref missing, ref missing, ref missing,
                                    ref missing, ref missing, ref missing,
                                    ref missing, ref missing, ref missing, ref missing);

will i open word in the server or in the client computer??

  • 1
    possible duplicate of [Opening Word Document on Client Side from Asp.net Application](http://stackoverflow.com/questions/11335125/opening-word-document-on-client-side-from-asp-net-application) – walther Aug 28 '14 at 10:49

3 Answers3

1

You don't want to run interop in IIS. Use a Word library.

But to answer your question, serverside code runs on the server so yes, you'll have to install Office on your web server if you're absolutely sure you want to use interop.

Community
  • 1
  • 1
CodeCaster
  • 147,647
  • 23
  • 218
  • 272
0

There would be performance issue if you are trying to open word editor on server or client machine.. If you open a word editor and update the file it means that your are updating the file so One simple solution is for the user to download the file, edit it and upload it back to you.

yogi970
  • 446
  • 5
  • 14
  • so what is the best solution to modify a word document with asp.net? – Salah Smiti Aug 28 '14 at 11:40
  • as i suggest just downlaod the file make changes and upload new file there..this will be best approach your server will have less burden of opening of word document. – yogi970 Aug 28 '14 at 11:51
  • how can i make changes in the file without opening microsoft word? – Salah Smiti Aug 28 '14 at 11:53
  • Client will have to open the any word editing software after downloading the fie from your server then client can make chnages and again upload to server! – yogi970 Aug 29 '14 at 09:08
  • Else you can read your word doc by server side code and display text on the web page then client will be able to edit the text from rich text box and simple save it.In this whole process you will not need any word editor! – yogi970 Aug 29 '14 at 09:10
  • what i want is to edit the word document on the server then download it for the client not the inverse – Salah Smiti Aug 29 '14 at 09:22
0

You've to install Microsoft Office at the server because the Microsoft.Office.Interop uses an actual instance of Word.

Microsoft discourages the use of Word in a server environment as Word is a desktop application. If a dialogue or error occurs while working with the word document there are no way to handle this.

Alternatively, there are several external libraries designed for server use, but I don't know any free ones.

Søren Gørtz Olesen
  • 1,775
  • 2
  • 10
  • 6