mikeg wrote:
there are 2 divisions.
there is a word-document loaded in first division.
? Does this mean you have a Word document loaded using IE and the Word
plugin? If so, why not just use that to edit the document?
On the other hand, if you are trying to copy from the Word document and
paste the content into an HTML page, that is quite different.
when the user clicks somewhere in the document, i need some event to
return to me something that is a valid activedocument.range, so i can
select it and work with it.
Microsoft have implemented document.selection(), which, when combined
with other methods such as createRange, can be used to create an
object. You can then use methods of the range object to do whatever.
<URL:http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/obj_selection.asp>
You should also Google for window.getSelection(), which appears to be
the DOM equivalent though documentation seems pretty scant.
<URL:http://www.w3.org/TR/MathML2/appendixe.html>
You likely need to use a mix of both methods to get the text, then
create a new object and play with it. Once you get the object into
DOM-space, you should be able to use that to insert it into the web
page in a reasonably cross-browser way.
Quirksmode comes to the party again with an example and information:
<URL:http://www.quirksmode.org/js/selected.html>
There is also a fairly extensive implementation posted here:
<URL:http://groups-beta.google.com/group/comp.lang.javascript/browse_thread/thread/1d3ea102d4978d9a/51e158e6aa8c15bb?q=document.createRange&rnum=1&hl= en#51e158e6aa8c15bb>
--
Rob