Skip to main content

In this case for example (shapewithtext)


sel.text.hyperlink.value doesn’t give hyperlink as hyperlink is undefined. Did I miss something or it is expected ?



I get undefined : do you spot anything wrong ?


let hyperlinkTarget = (((sel as ShapeWithTextNode).text).getRangeHyperlink(0, sel.text.characters.length)) as HyperlinkTarget;
hyperlink = hyperlinkTarget.value;
alert(hyperlink);

You are again getting the link on the whole node. If you have a link only on the part of the node, the range needs to be just that part, otherwise it’s mixed. If you don’t know the exact range, you should process the text character by character to find the characters with links.


Oh thanks, I didn’t suspect it could be so circumvulated (for style I can understand it’s character by character but for hyperlink it’s a whole so it’s weird for me) but will try again 🙂


Reply