By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,963 Members | 1,994 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,963 IT Pros & Developers. It's quick & easy.

Save As Word document using execCommand

P: 59
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
Share this Question
Share on Google+
4 Replies


P: 59
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

10K+
P: 13,264
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
Expert Mod 15k+
P: 16,027
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
Expert Mod 15k+
P: 16,027
I've merged the threads and changed the thread title.
Jun 29 '07 #5

Post your reply

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