How do I get a reference to the textframe that the selected text is in?.
Ups, a bit to late, sorry for that ...
first, selection is a array. So you have to loop through the items to get each parent text frame.
if selection[someitem] is word or paragraph you can use parentTextFrames, which is an array again
if selection[someitem] is a table it's parent ...
if selection[someitem] is a anchored object it should be parent.parentTextFrames
Guess I'm missing a lot possibilities ;-)
Thank you for your reply. I should have thought about what I really needed. I'm trying to the the xml for the textframe of the selected text.
I have l2elements = app.selection.parentTextFrames.associatedXMLElement.xmlElements
is always 0;
Thanks in advance.
Europe, Middle East and Africa