Forum Moderators: open

Message Too Old, No Replies

Using document.execCommand('SaveAs')

Problem saving a document

         

jenkinssq

4:10 pm on Sep 13, 2004 (gmt 0)



I have a frameset containing 2 frames, in the top frame I am loading a word document template and in the bottom frame I have a html page with a couple of buttons; 1 to close the document and 1 to save the document.

I am trying to use the document.execCommand('SaveAs') command but this only seems to work if the document in the top frame is a html document it will not work if it is a word document.

If anybody has any suggestions as to how to get this working or has an alternative method of saving a word document using javascript (or any other client side language) I would welcome them.

Thanks in anticipation.

adni18

1:06 am on Sep 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Okee do.

Here goes:

begin frameset.html---------

<FRAMESET rows=40,*>
<FRAME src=navbar.html name=navbar>
<FRAME src=mydoc.doc name=mainframe>
</FRAMESET>

end frameset.html----------

begin navbar.html----------

<input type=button value="Save As" onClick="window.parent.mainframe.focus();document.execCommand('SaveAs')">
&nbsp;&nbsp;
<input type=button value="Close Document" onClick='window.parent.mainframe.location="about:blank"'>

end navbar.html---------

I reckon that'll work. Haven't tested it tho