Page 1 of 1

Word selection

Posted: Fri Mar 13, 2015 10:21 am
by Angelo
To select a word in a document (i. e. doc, pdf, txt) you can use the combination (ctrl | shift | left arrow). So far, I used the following code, which I compiled to an exe-file and assigned a shortcut to it.

Code: Select all

XIncludeFile "COMatePLUS.pbi"
oScript.COMateObject 
oScript = COMate_CreateObject("WScript.Shell")

command$ = "(^+){LEFT}"
oScript\Invoke("SendKeys('"+command$+"')")
Delay(50)

oScript\Release()
That worked fine with Win XP, however it failed with Win 7. Does anyone know, what happened? Btw, a solution including the Win-Api function keybd_event() doesn't work either.