How do I get to an element from a text location ? As my document is structured I am always in an element, but there does not seem to be a way to get there easily. I tried doc.ElementSelection but that just gives me ivalid elements.
Thanks for any pointer in the right direction
Did you end up working this out? I'm trying to do the same thing now and looking for the answer....
It turned out to be really simple: you can translate between text locations and element locations using two methods (one for each direction).
var oTRange = oDoc.TextSelection;
var oTLoc = oTRange.beg; /* beg and end are two TLoc objects, which will be the same
if no text is selected */
var oELoc = oDoc.TextLocToElementLoc( TLoc );