Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2001-09-07
10
Medium Priority
?
170 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
  • 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 200 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
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…
Suggested Courses

824 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