Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I try to open a word document in my web application. It opens fine on localhost, but now I am publishing my web application on a server.

Users that access the published web application (like can not open the word document on their system.

winword.exe opens on the server but can not open the word document.

Access my system to author systems also same problem is coming. (Word document does not open on user's system. The word instance opens on my system.)

share|improve this question

migrated from stackoverflow.com Aug 31 '09 at 5:42

This question came from our site for professional and enthusiast programmers.

closed as off topic by Joel Coehoorn, random Aug 5 '10 at 16:24

Questions on Super User are expected to relate to computer software or computer hardware within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

This is a programming error and should have remained on StackOverflow –  Joel Coehoorn Aug 4 '10 at 23:20

6 Answers 6

What does your ASP page? Reading the description of your issue, it looks like Word is started by the ASP page on the system where the ASP page runs. That's why it works on your PC, using localhost, as you have Word installed on your PC. You say that winword.exe opens on the server, another proof of that. Maybe the Word document is actually opened on the server, but running in another session or within a different account, the account running the IIS/ASP server.

I'm not sure I understand what you want to do? If you want to serve Word docs to the users, you should not launch them in the ASP page, but simply transfer them to the users browser.

share|improve this answer

I believe you need something that will open a .DOC on the client.

The reader (FREE) software should suffice though.



share|improve this answer

The user probably does not have software installed to view the document as Daniel said, it would be better to have ASP.NET convert the document to HTML then present it to the user, since this is a more convenient solution for your viewers. You can find out how to use COM objects with Word here.

share|improve this answer

It may be that some security measure blocks you from opening documents from the web.
The reason behind it is that Word documents may contain viruses as macros.

To verify if this is indeed the case, you may:

  • Invoke the browser using "Run as administrator"
  • Turn off all anti-virus and firewalls
  • Turn off UAC

If one of these measures corrects the problem, then this will tell you which product needs some tweaking.

share|improve this answer

Word documents used to have macro viruses and so are not considered trustworthy even to this day. Will another document format (such as ODF) work?

PDFs used to be a safe bet but that's changing.

share|improve this answer

You have code in your asp.net page that opens up the document in word. That is not you do this. You're doing it wrong.

That code runs on the server, not on the client, and so of course Word opens on the server rather than on the client. What you need to do instead is have the http request that results in this code instead use something like Response.BinaryWrite() to return the .doc file to the client's computer. You also add a content-disposition:attachment header along with the correct content-type and the user's browser will then start Word on their machine with that document opened.

share|improve this answer