Last post Jul 20, 2010 10:19 PM by Careed
Jul 07, 2010 10:33 AM|ysommer2|LINK
Is there a way to open a word document in Microsoft Word directly from from an ASP.NET webpage without having the save/open dialog pop up?
To be more clear, Here is how I want my app to work. The user clicks on a link. The word file is copied from the web server to local computer and opens the document in MS word.
ASP.NET 3.5 C#
Jul 07, 2010 11:07 AM|Careed|LINK
You will need to have direct access to the client's computer to copy a file directly to a specific location as well as open Word from the client. Since you are using a web application, this is not very practical nor secure.
Jul 07, 2010 12:26 PM|ysommer2|LINK
How about using an ActiveX or Silverlight component?
Jul 07, 2010 04:58 PM|Careed|LINK
Unless you have full control on the client's computer, you cannot access the file directly. This is why you get a file dialog because a web page does know the layout of your computer files. Additionally, even if you had limited access, you could be guarantee
that the files would be in the same exact location from client machine to client machine.
So, what exactly are you wanting to do with this? Maybe we can come up with another solution that resolve your issue.
Jul 20, 2010 09:04 PM|CharissaJB|LINK
I am trying to do something similar. I have been unsucessful in finding a solution to this as well. I am actually storing the word document in SQL Server. When the user clicks a button I am "streaming it to their “PC" (would rather it be network shared
drive). Once they do their editing and saving I want to grab the edited/saved document from the network shared drive and have the ASP page save it back to SQL Server.
You had mentioned that you could not guarantee where it would be located on the client machine. Is there any way to manipulate the browser and tell it where you want word to open the document once it streamed? As mentioned, I would
actually like to save it to a network shared drive that both that currently the client and server have access to. This is an Intranet implementation and is behind a firewall.
Redirect ASPX Page
How to open ms-word file when path is given in database
ASP.NET 3.5 C#
Jul 20, 2010 10:19 PM|Careed|LINK
The problem with using a network share is that the browser will likely not have any means of connecting to it. Remember that the browser itself is a client-based application that you may be able to manipulate if you have some control of the user's computer.
Besides all of the security issues associated with these, this is unlikely in Internet-based web application.
Overall, you need to disassociate the Internet from your network when thinking about how it works. A web-based cannot operate like an operating system because it has to be independent of the OS so that any user can access your web application from any operating
systems, not just Windows. As such, you would need to program for all variations associated with Windows, Linux, etc.
Now, granted, you have an intranet application and you have a little more control over it. Still, you have issues with being able to use network shares from your web application, which typically will use an anonymous login user which will unlikely have
any access beyond the web application's computer.
So, why does it have to be a Word document? Can it be something else?