The following code saves 1-of-2 sources depending on the composed content:
1. its intended composition-- if docobj.write-sText begins with '<PRE></PRE>'
2. its javascript opener (editer) document-- if write-sText begins with '<HTML>' (eg.)
eg.
docobj.write('<HTML>'+headstyles.outerHTML+composed.outerHTML);
docobj.execCommand('SaveAs',true,'subdoc'); // saves javascript opener
NB.
3. saveAs onUnload by Window closure (eg. alt-F4) may fail (directory gets a file of 0KB) ... User can-try save from Refresh (eg. F5) before closing Window, but can-fail.
(onUnload issue can be fixed with onBeforeUnload)
[24 - July 2008] You [can] post specific questions [in] the MSDN Forums at http:/forums.microsoft.com/msdn. You [may] get a quick response.