No way to do this? OK, then let me ask the question in a different way.
I'm not an XML expert so bear with me if I use the wrong terms here. What I'm generally trying to do is to "connect" pasted text blocks with the document's XML structure. The reason behind this is that I need to be able to swap out blocks of text later to update the document. All I managed to do is to get the beginning of the pasted block into the document's structure, but not the whole block.
Thanks for your help.
let me try to understand ... you want to insert the pasted text into an XML-Element in your document structure? Not really a problem. First you need to find the location in the XML DOM where you want to put the text (or just add an XML-Element there).
storyRootTag = thisStory.associatedXMLElement;
xmlElement = storyRootTag.xmlElements.add("THE_XML_ELEMENT");
Then, with the XML-Element do something like
xmlElement.insertionPoints.item(-1).contents = <YOUR PASTED TEXT>
If you want to do it in one go (Command-V) you need to attach an EventHandler to that keystroke (even though overriding the default is never a good idea).
Sorry for not replying earlier. Something came up and this issue had to wait.
Yes, that's pretty much what I do. My problem is (I should've been more clear about that) how to get <YOUR PASTED TEXT>. I can't find any object that contains the stuff I pasted into my document (using Application.Paste() ). I'm kinda stuck here.