RSS Forums RSS
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 6561 | Replies: 19
Reply
Join Date: Feb 2007
Location: New Delhi, India
Posts: 53
Reputation: Hellodear is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Hellodear's Avatar
Hellodear Hellodear is offline Offline
Junior Poster in Training

Re: how can i display the ms word document in asp page?

  #11  
Mar 29th, 2007
Hollystyles,
Thanks, code sounds good. But displaying error at IE. Below is the output:
Attached Files
File Type: zip anish_asp.zip (1.6 KB, 20 views)
Reply With Quote  
Join Date: Feb 2005
Location: Braintree, UK
Posts: 1,166
Reputation: hollystyles will become famous soon enough hollystyles will become famous soon enough 
Rep Power: 7
Solved Threads: 59
hollystyles's Avatar
hollystyles hollystyles is offline Offline
Veteran Poster

Re: how can i display the ms word document in asp page?

  #12  
Mar 29th, 2007
Did you use the later code I posted? after davidcairns' post in which I added these two lines

  1.  
  2. Response.Addheader "ContentType", contentType
  3. Response.Addheader "Content-Disposition", "inline; filename=" & fileName
  4.  

I was getting the same result as you on my PC until I added those two lines, also I had to close down and restart IE so it didn't use the local cache (you know temporary internet files) and It works fine on my PC now.
==========================================
Yadda yadda yadda...
Web junky, fevered monkey
Reply With Quote  
Join Date: Feb 2007
Location: New Delhi, India
Posts: 53
Reputation: Hellodear is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Hellodear's Avatar
Hellodear Hellodear is offline Offline
Junior Poster in Training

Solution Re: how can i display the ms word document in asp page?

  #13  
Mar 29th, 2007
Dear Holystyle,
Now I got. It is working properly. Thanks in advance. Now i'm vacating from this thread.
Thanking you,

Anish
Mahatma Gandhi Colony
Reply With Quote  
Join Date: Apr 2007
Location: california
Posts: 4
Reputation: furianera is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
furianera furianera is offline Offline
Newbie Poster

Re: how can i display the ms word document in asp page?

  #14  
Apr 14th, 2007
hello everyone,
i must dislay a word document into a asp page.
i tried with iframe but it didn't work proprely so i need ur help.
I have this .doc document with some text into, and i have to display the document into my website, in a page written in ASP.
i tried with the code in this discuss but it work only like a download, but i wanna display the contenent of the page into the browser without manual download.
hope u can help me,
regards
Reply With Quote  
Join Date: Feb 2007
Location: New Delhi, India
Posts: 53
Reputation: Hellodear is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Hellodear's Avatar
Hellodear Hellodear is offline Offline
Junior Poster in Training

Re: how can i display the ms word document in asp page?

  #15  
Apr 14th, 2007
Hi,
Try this code: Make changes to file name and location

<% @Language=VBScript %>
<%
Option Explicit
Dim fileName, filePath, contentType, objStream
fileName = "anish.doc"
filePath = "C:\" & fileName
contentType = "application/msword"
Response.Buffer = true
Response.Clear
Response.ContentType = contentType
'Response.CacheControl = "no-cache"
'issue for IE no-store doesn't work either
Response.Addheader "ContentType", contentType
Response.Addheader "Content-Disposition", "inline; filename=" & fileName
Set objStream = Server.CreateObject("ADODB.Stream")objStream.Open
objStream.Type = 1
objStream.LoadFromFile filePath
response.BinaryWrite objStream.Read
objStream.Close
Response.Flush
Response.End
%>

This code had already submitted by somebody. I hope this would help to rectify your problem. try this code and send feedback to this thread.
Reply With Quote  
Join Date: Apr 2007
Location: california
Posts: 4
Reputation: furianera is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
furianera furianera is offline Offline
Newbie Poster

Re: how can i display the ms word document in asp page?

  #16  
Apr 14th, 2007
it works but it isn't what i meant .
This code "asks" me to download or save the file like a normal link 4 the download does, but it isn't what i want.
I want a code that allows me to view a document into the browser and not a code like urs that i have to download before i can view it.
can u help me out??thanx so much
Reply With Quote  
Join Date: Feb 2007
Location: London
Posts: 114
Reputation: davidcairns is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 8
davidcairns davidcairns is offline Offline
Junior Poster

Re: how can i display the ms word document in asp page?

  #17  
Apr 14th, 2007
2 things to note here

1. If you want to use MS Word integrated into the browser it will still depend to some extent on the users client settings, ie whether word is allowed to integrate with IE, Firefow, Opera or whatever they have. Even if you say inline on the disposition that doesn't mean the client is required to treat it that way.

2. If you actually want to display the contents in an HTML page then you may have to convert the word document to HTML or Text
Reply With Quote  
Join Date: Apr 2007
Location: california
Posts: 4
Reputation: furianera is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
furianera furianera is offline Offline
Newbie Poster

Re: how can i display the ms word document in asp page?

  #18  
Apr 14th, 2007
i've just tried point 2 but the text format and the alignment of the columns aren't like in the original document. moreover, i haven't understood what u meant in point 1! could u explain it again, please????thanx so much!
Reply With Quote  
Join Date: Feb 2007
Location: New Delhi, India
Posts: 53
Reputation: Hellodear is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Hellodear's Avatar
Hellodear Hellodear is offline Offline
Junior Poster in Training

Troubleshooting Re: how can i display the ms word document in asp page?

  #19  
Apr 15th, 2007
furianera,

Please submit the full procedure that you have done in this business. I hope you don't have MSOffice installed on your computer. Go to internet explorer, click tools menu and internet option. Then go to Advanced Tab and click Reset Advanced settings.
------------------------------------------
1. You have to save the below mentioned code with the extension as .asp.
You have to edit the location specified in tht code, with your document name, and location.
And disposed it in your inetpub/wwwroot/ folder.
Type http://localhost/'filename.asp' at the address bar and press enter.

Because it is functioning properly in my computer.
------------------------------------------
2. Or if you want to make it as a text format, open the said document thorugh MS word, click file menu and select Save As Web page. That is all. And run it (Double click).

Good Luck
Reply With Quote  
Join Date: Apr 2007
Location: california
Posts: 4
Reputation: furianera is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
furianera furianera is offline Offline
Newbie Poster

Re: how can i display the ms word document in asp page?

  #20  
Apr 15th, 2007
HelloDear well in my laptop i've installed openoffice, and i have reset all the advanced options of IE.
i've just done all the things that u mean in the point 1, run the .asp file in my ie but my browser still asks me the download of the file and it doesn't open the document directly in the browser. so i don't understand your point.
Point 2:
i've just done also this way, but the results isn't good so i want the document (.doc) to be opened into the browser.
Today i tried this code:
<% response.ContentType ="application/msword" %>  
<!--#include virtual="/myfile.doc" -->
but still works like a download..
i apologise for all the drawbacks
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 3:55 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC