473,396 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Opening a Word Document in a browser (C#)

I just worked through a VB.Net sample program that creates an rft document
and then opens it in Word. The code that opens the document is:
Dim sFileName As String

sFileName = "Sample1.doc"

Response.Write( "<META HTTP-EQUIV=""REFRESH"" Content=""0;URL=" & sFileName
& """>")

I cannot get this to work in C#, can anybody show me how to construct this
statement in C#. Also, where can I find some documentation about how this
works

Thanks in advance for any help.

Walter

wl*****@sigsys.net


Nov 16 '05 #1
1 4357

That's not a good way to do it. It'd be better to set the
content-type and content-disposition headers and then stream the doc
out to the response directly.

The meta refresh thing is using a client-side HTML redirect which
requires a second round-trip to the server. Besides that, an HTTP
redirect would be cleaner (but still require a redirect).

HTH,

Sam
On Wed, 16 Mar 2005 11:12:52 -0500, "Walter Levine"
<wl*****@sigsys.net> wrote:
I just worked through a VB.Net sample program that creates an rft document
and then opens it in Word. The code that opens the document is:
Dim sFileName As String

sFileName = "Sample1.doc"

Response.Write( "<META HTTP-EQUIV=""REFRESH"" Content=""0;URL=" & sFileName
& """>")

I cannot get this to work in C#, can anybody show me how to construct this
statement in C#. Also, where can I find some documentation about how this
works

Thanks in advance for any help.

Walter

wl*****@sigsys.net


B-Line is now hiring one Washington D.C. area VB.NET
developer for WinForms + WebServices position.
Seaking mid to senior level developer. For
information or to apply e-mail resume to
sam_blinex_com.
Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: RandyB | last post by:
I built a web app that creates and saves a WordML file on disk (with a processing instruction in it for Word.Document). When this file is requested from a client machines, the client's browser...
3
by: Andy Davis | last post by:
I have set up a mail merge document in Word 2003 which gets its data from my Access 2000 database. I want to set up a button on a form that: 1. runs the query to provide the dat for the merge...
3
by: Yohancef Chin | last post by:
Hi, Being fairly new to .NET I am looking for a way to call MS Word from an event on a webform, and after the user is finished save that created document to an SQL Server database. Has anyone...
4
by: Thomas Scheiderich | last post by:
I can't seem to open a word document from any of my browsers except the one on my web server. Here is the .aspx file: ***************************************************************** <%@...
3
by: richi | last post by:
Hello, i'm hoping that somebody can point me in the right direction with my problem. I have been tasked with creating a simple browser based application that will allow the user to upload Word...
4
by: enak | last post by:
I need to open a Word template so that I can merge some data from a database with the document. I am using ASP.NET, VB.NET. I can not even get MS Word to be visible. I can see that an instance is...
2
by: Colin Halliday | last post by:
I have a Word 2003 mail merge main document (form letter) that is linked to another Word document data source for the mail merge. If I open this doc using the Word GUI, it first asks me to...
5
by: Cedric | last post by:
Hi Folks, I'm wondering if someone has already succeed to open a word2000 document located on server side with javascript code executed by a web browser on client side. In fact, i make it...
1
by: captainwin | last post by:
Here's the problem: - Website is ASP.NET 1.0 - Server is Windows Server 2003 - Browser is IE 6/7 - Client requests a mail merged MS Word 97 - 2003 document on the website, and the document gets...
2
by: icewalker | last post by:
Hi I have been trying to open a new window in Word/OO Writer with JS using the following code (and numerous variations I could add...): tw = window.open('about:blank','');...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.