Hello Guest it is April 23, 2024, 03:17:38 AM

Author Topic: SendKeys question  (Read 2020 times)

0 Members and 1 Guest are viewing this topic.

Offline BR549

*
  •  6,965 6,965
    • View Profile
SendKeys question
« on: June 03, 2011, 05:27:18 PM »
Calling all VB gurus. Can you goive me an example of code that opens notepad and using sendkeys send keystrokes.

I read the manual and it makes sense but I cannot get it to work. It seems to have a focus problem I can't solve.

I use:

Shell("notepad.exe")
sendkeys "Just a test",true
sleep 10000
Sendkeys "%{F4}",true
end

This should open notepad insert "Just a test" and then wait 10 seconds and close notpad.  While Machvb is in focus it runs up to the sendkeys and stops. IF I click on notepad and gain focus the VB stops .

Any ideas or examples would be appreciated, (;-) TP