Solved

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

Posted on 2001-09-07
10
158 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 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
 

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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

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-…
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
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…

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now