473,320 Members | 1,719 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,320 software developers and data experts.

Word doc not opening in ie

Hi all

C#, .net1.1, plain old aspx page with nothing on it.

The aspx page is named ViewComments.aspx

I read a clob column from an Oracle db.
then I send it to the Response out like this:
//Where the clob data is found in the DataSet ds

sComment = ds.Tables[0].Rows[0]["COMM_TEXT"].ToString();
long fSize = sComment.Length;

if (Convert.ToInt32(sComment.IndexOf(@"\rtf1\ansi\")) 0)
{
sContentType = "application/msword";

Response.Clear();
Response.ContentType = sContentType;

System.Text.ASCIIEncoding encoding=new
System.Text.ASCIIEncoding();
Response.OutputStream.Write(encoding.GetBytes(sCom ment), 0,
Convert.ToInt32(fSize));

Response.End;
}
This works perfect on my dev machine. When the form opens, the user is
prompted to open or save the Doc.

When I move it to any other machine, the user is prompted to open or
save ViewComments.aspx (my aspx file name) not the doc.
Type shown on save dialog is "ASP.NET Server Page 83.kb"

Why doesnt this work anywhere other than where I built it?
Thanks
Jeff

Jul 17 '07 #1
1 1780
Jeff User,
Couple ideas:

1) This looks like RTF, not word. Of course it should load in word, but
what's the MIME type for RTF?
2) with this -System.Text.ASCIIEncoding encoding=new
System.Text.ASCIIEncoding();
Response.OutputStream.Write(encoding.GetBytes(sCom ment), 0,
Convert.ToInt32(fSize));
-- what I'd consider doing is to get the whole thing into a string first and
verify that you've got what you think you have.

3) Is "Response.End" a legitimate C# method call? Shouldn't this be
Response.End()..?

4. Are you sure your ASPX "Page" ONLY has the @Page declaration and nothing
else?
--Peter
--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
bogMetaFinder: http://www.blogmetafinder.com

"Jeff User" wrote:
Hi all

C#, .net1.1, plain old aspx page with nothing on it.

The aspx page is named ViewComments.aspx

I read a clob column from an Oracle db.
then I send it to the Response out like this:
//Where the clob data is found in the DataSet ds

sComment = ds.Tables[0].Rows[0]["COMM_TEXT"].ToString();
long fSize = sComment.Length;

if (Convert.ToInt32(sComment.IndexOf(@"\rtf1\ansi\")) 0)
{
sContentType = "application/msword";

Response.Clear();
Response.ContentType = sContentType;

System.Text.ASCIIEncoding encoding=new
System.Text.ASCIIEncoding();
Response.OutputStream.Write(encoding.GetBytes(sCom ment), 0,
Convert.ToInt32(fSize));

Response.End;
}
This works perfect on my dev machine. When the form opens, the user is
prompted to open or save the Doc.

When I move it to any other machine, the user is prompted to open or
save ViewComments.aspx (my aspx file name) not the doc.
Type shown on save dialog is "ASP.NET Server Page 83.kb"

Why doesnt this work anywhere other than where I built it?
Thanks
Jeff

Jul 18 '07 #2

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

Similar topics

3
by: TLMM | last post by:
I have a Word doc already created that I want to open from an asp page. I want it to open in Word and allow the user to modify if necessary. I currently have it opening (using href), but it is...
0
by: Sivaraman.S | last post by:
Issue: When I am opening a word document or a template from an ASP.NET Web page (language used VB.NET Visual Studio Version 2003) using Word.ApplicationClass object (Reference Word 11.0 object...
5
by: Niklas Uhlin | last post by:
Someone please explain why Session_Start fires multiple times / retains SessionID values between sessions, when you open an ASP.NET page from MS Word. For details of the problem, see below: 1....
3
by: Scupper | last post by:
I am working on adapting a process currently handled by VBA functions in a Word template, moving to a VB.NET app that calls Word only when necessary to manipulate documents (essentially, it is...
0
by: senthilavs | last post by:
Hi, Im having word document in the Server Machine. While im trying to open the file in Client Machine file is opening in Server only. I need to open in the client only. This is an ASP.NET project...
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...
4
by: jefftim | last post by:
Hi All I've saved a word document in sql server database.I'm able to retrieve it from the database and open it in a word application. My problem is as i have to use this in an intranet...
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
1
by: webgirl | last post by:
Hi everyone, I have a weird problem with some Word/Excel automation code that I run from Access (not sure if I should therefore post this in the Access forum..? Thought I'd try here first) ...
1
navanova
by: navanova | last post by:
Greetings, I have a problem of opening ms word and excel files on my computer. The files are there for a long time. I use to open and modify them. Suddenly, when i try to open the word files, a...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.