How to get the string of text located at the current mouse locatio

  • Thread starter Thread starter Dave Jenkins
  • Start date Start date
D

Dave Jenkins

My users want to be able to point anywhere in a continguous string of text in
a textbox, and then do something with that particluar string. They
specifically don't want to have to select the text - they just want to point
and shoot.

Is that at all possible with VBA? I can get the pixel location of the mouse
pointer, but after that I don't know what to do to convert that to the string
of text there.

Is this at all doable? Or do I just tell them, "Sorry - can't be done?"
 
Hi Steve:

No mindreading involved. The application is this: if, in the editor, they
see a URL on a slide, they want to click anyplace in it (instead of selecting
it) and browse to that site with the user's default browser. I've got all
that working ok, but the way I've got it written now requires them to select
the URL in question. I don't see that that's such an onerous requirement
myself, but I thought I'd investigate trying to do what they want, and ended
up getting stumped.
 
No can do on the right-click op -- because of our production requirements, we
remove the hyperlink formatting from URLs and they show as a "normal" string
of text.

However, your VBA snippet holds some possibilities, which I will now go off
and investigate - thanks! (And of course, I feel compleed to add that having
a regular expression search available to me will make the search for a URL in
the text returned from your VBA code a snap!)
 
Back
Top