473,406 Members | 2,220 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,406 software developers and data experts.

Save As Word document using execCommand

Hi all, I am trying to add a button to my webpage that opens the save as dialog box, and allows the users to save the page (it is a form) as a word doc... I used this code which does work, but only allows to save as a txt or html file... Is there any way to make it so that they can save it as a .doc file to be able to edit it later?

[HTML]<input type="button" value="Save Form" onClick="javascript: document.execCommand('SaveAs','1','EvalForm');"/>[/HTML]
Jun 28 '07 #1
4 8800
Hi all, I am trying to add a button to my webpage that opens the save as dialog box, and allows the users to save the page (it is a form) as a word doc... I used this code which does work, but only allows to save as a txt or html file... Is there any way to make it so that they can save it as a .doc file to be able to edit it later?

Code: ( text )

1.
<input type="button" value="Save Form" onClick="javascript: document.execCommand('SaveAs','1','EvalForm');"/>
Jun 28 '07 #2
r035198x
13,262 8TB
Hi all, I am trying to add a button to my webpage that opens the save as dialog box, and allows the users to save the page (it is a form) as a word doc... I used this code which does work, but only allows to save as a txt or html file... Is there any way to make it so that they can save it as a .doc file to be able to edit it later?

Code: ( text )

1.
<input type="button" value="Save Form" onClick="javascript: document.execCommand('SaveAs','1','EvalForm');"/>
Moved to Javascript forum
Jun 28 '07 #3
acoder
16,027 Expert Mod 8TB
Being non-standard code, it'd difficult to say for certain, but I think you'll probably have to do something server-side and let the user download it instead. That's actually better, because it would work in more browsers rather than just IE.
Jun 29 '07 #4
acoder
16,027 Expert Mod 8TB
I've merged the threads and changed the thread title.
Jun 29 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: lir | last post by:
Hi, I am trying to save a fram in a page using the execCommand("saveas") the html is save currectly but I can not save the gif on that page. How can I save the fram with the gif via...
10
by: Martin Dale | last post by:
Dear all, Is there any way to activate the Save As command from Javascript. I would like to have a "Save as" button on a page which has been dynamically created (client side using...
3
by: 00steve | last post by:
Hi, I was wondering if anyone knew how to go about having a "save as HTML" option incorporated within a page. (I know the option is available from the file menu from within IE, but a client has...
0
by: SAL | last post by:
Below is my javaScript function that I am having trouble with. When I set the bUserInterface parameter to FALSE in the follow statement, "document.execCommand("CreateLink","false", oSource)", the...
11
by: Thomas Magma | last post by:
I have a simple JavaScript application that will generate some text type data for the end user. Is it possible to have a button that will allow them to save this information to a text file? ...
3
by: =?Utf-8?B?YXNkZg==?= | last post by:
Hello. I am making a web application with c# and am using this code: Response.ContentType = "application/x-excel"; Response.AddHeader("Content-Disposition", "attachment;filename=" +...
0
by: ppardi | last post by:
I'm developing an addin for Word 2007 and I need to determine whether a user saves a Word 2007 document in an older format (97-2003) after a save as is done. The scenario is that the user starts...
2
by: guilherme21922 | last post by:
I want to on a click button save a file: The file is in D:\FilesExport\Custumers.txt. I tried to do this but nothinh happens! ...
2
by: ejrfigueiredo | last post by:
Hi, Is there a way to get a script function to save a page without the execCommand (which works on IE but doesn't on Firefox). Below there's the code I'm using, I took it from a template page...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.