How do I get a reference to the textframe that the selected text is in?.
Edit:
Ups, a bit to late, sorry for that ...
HI,
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[0]
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[0].parentTextFrames[0].associatedXMLElement.xmlElements
but
lim=L2elements.length;
alert(lim)
is always 0;
Thanks in advance.
North America
Europe, Middle East and Africa
Asia Pacific