Solved

How to save the content as .doc file from the browser?

Posted on 2001-09-07
10
163 Views
Last Modified: 2008-03-10
I want to give an option in my site where the user can save the content of the page as a .doc file where ever he/she is browsing. Is there any way in javascript with which i can do this?
0
Comment
Question by:softganesh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +3
10 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 6464261
Not natively.

With activeX you might...

Michel
0
 
LVL 46

Accepted Solution

by:
fritz_the_blank earned 50 total points
ID: 6464680
You can do it this way, but it is not a very good idea to do so:

<%@ Language=VBScript %>
<%Response.Buffer = True%>

<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
</HEAD>

<%
'This codes assumes the existence of a folder named "HTMLConvert" on the desktop
'It will be neccessary to change the path when implemented
dim strDocName, strFileName
strDocName = Request("DocName")
dim WordApp
set WordApp = CreateObject("Word.Application")
WordApp.visible = false
strFileName = strDocName + ".htm"
Response.Write(strDocName + "<br>")
Response.Write(strFileName)
WordApp.Documents.Open("C:\windows\desktop\HTMLConvert\" + strFileName)
numChars=WordApp.ActiveDocument.Characters.Count
set myrange = WordApp.ActiveDocument.Range(0,numChars-20)
myrange.select
WordApp.Selection.Copy
WordApp.ActiveDocument.close
WordApp.Documents.add
WordApp.Selection.paste
strFileName = strDocName + ".doc"
WordApp.ActiveDocument.SaveAs("C:\windows\desktop\HTMLConvert\" +strFileName)
WordApp.ActiveDocument.Close
WordApp.Quit
set WordApp = Nothing
Response.Redirect(strFileName)
%>

</SCRIPT>
<BODY>


</BODY>
</HTML>
0
 
LVL 9

Expert Comment

by:msdixon
ID: 6464745
you can generate it with server-side script like asp, but not client-side javascript.
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

Author Comment

by:softganesh
ID: 6470290
My application is working in Oracle web server. So I can't use ASP.

Atleast, is there any way to do the same i.e., saving as .htm using javascript to the client machine?
0
 

Author Comment

by:softganesh
ID: 6470307
My application is working in Oracle web server. So I can't use ASP.

Atleast, is there any way to do the same i.e., saving as .htm using javascript to the client machine?
0
 
LVL 12

Expert Comment

by:ahosang
ID: 7967875
This question has been abandoned. I will make a recommendation to the moderators on its resolution in a week or so. I appreciate any comments that would help me to make a recommendation.
 
In the absence of responses, I may recommend DELETE unless it is clear to me that it has value as a PAQ. Silence = you don't care
 
ahosang
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 7968224
Split between me and Michel or to Michel only.

Fritz the Blank
0
 
LVL 12

Expert Comment

by:ahosang
ID: 8029226
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

SPLIT - mplungjan/fritz_the_blank
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
ahosang
EE Cleanup Volunteer
0
 
LVL 5

Expert Comment

by:Netminder
ID: 8092877
Per recommendation, force-accepted.

Netminder
EE Admin

mplungjan: points for you at http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_20543176.html
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 8093674
Thank you,

Fritz the Blank
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question