You
might be able to do this by displaying your text in a WebView.
Take a look at this page i created a while ago for another forum member:
http://code.martinpearman.co.uk/deleteme/cbanks/highlight_on_click.php.
Click a paragraph and it gets highlighted, click again and it is un-highlighted.
Each paragraph of text is an HTML
div element and the webpage javascript detects clicks on paragraphs and can send the highlighted paragraphs to a b4a Sub.
You want to detect clicks on single words...
Do you have control over the webpage HTML content - can you modify the webpage so that each word you want to be able to detect a click on is contained within an HTML
span element?
If so it'd be trivial to adapt the code from the above link to detect clicks on span elements instead of div elements.
What i'm saying here is that you take text such as:
Aenean sed mi justo, commodo imperdiet urna.
And modify it to:
<span>Aenean</span> <span>sed</span> <span>mi</span> <span>justo</span>, <span>commodo</span> <span>imperdiet</span> <span>urna</span>.
The webpage javascript can now detect which span element has been clicked, get the span element's text and send it to a b4a Sub.
If however you have no control over the HTML content - say you load a 3rd party webpage hosted on the www - then you would have to excute some javascript that would find each and every word in the HTML and wrap it in a span element on the fly.
That's not impossible but you might end up wrapping words in spans where you don't want to detect clicks.
I just noticed you might also want to detect clicks on portions of text - that gets tricky.
Though if the portion of text was within a single span element (not multiple span elements) it'd be just as straightforward as detecting a click on a single word.
Martin.