An alternative way to send keystrokes can be achieved by using the Windows Scripting Shell object in VBScript:
VBSTART
Sub Send
Dim Wsh
Set Wsh = CreateObject("Wscript.Shell")
Wsh.AppActivate "Notepad"
Wsh.SendKeys "Hello World{ENTER}"
End Sub
VBEND
Run>Notepad
WaitWindowOpen>Notepad*
VBRun>Send
This could be useful where you need to send keystrokes from within a complicated VBScript routine and/or would prefer to keep control within VBScript.
For further details and a list of key codes see:
http://msdn.microsoft.com/library/en-us ... ndkeys.asp
Send keystrokes with VBScript
Moderators: Dorian (MJT support), JRL, Phil Pendlebury
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact: