SendKeys string-expression[, wait]
Sends keystrokes to the active application.
Parameter Description
string-
expression The keystrokes to be sent. For details, refer to the Comments section below.
wait If True, SendKeys does not return until all keys are processed. If False, SendKeys does not wait for an application to process the keys. The default wait value is False.
Comments
In string-expression, to specify that SHIFT, ALT, or CONTROL keys should be pressed simultaneously with a character, use appropriate prefix from the table below:
+ to specify SHIFT
% to specify ALT
^ to specify CONTROL
Parentheses may be used to specify that SHIFT, ALT, or CONTROL key should be pressed with a group of characters. For example, ''%(abc)'' is equivalent to ''%a%b%c''.
Since '+', '%', '^' ,'(' and ')' have special meaning to SendKeys, they must be enclosed in braces. For example string-expression''{%}'' specifies a percent character '%'.
The other characters that need to be enclosed in braces are '~' which stands for a newline or ''Enter'' if used alone, and braces themselves (use {{} to send '{' and {}} to send '}'). Brackets '[' and ']' do not have special meaning in EXTRA! Basic but may have special meaning in other applications, therefore, they need to be enclosed inside braces as well.
To specify that a key needs to be sent several times, enclose the character in braces, followed by a space, followed by the number of times the character is to be sent. For example, use {X 20} to send 20 characters 'X'.
To send a non-printable key, use a special keyword enclosed with braces:
Key Keyword
Backspace {BACKSPACE} or {BKSP} or {BS}
Break {BREAK}
Caps Lock {CAPSLOCK}
Clear {CLEAR}
Delete {DELETE} or {DEL}
Down Arrow {DOWN}
End {END}
Enter {ENTER}
Esc {ESCAPE} or {ESC}
Help {HELP}
Home {HOME}
Insert {INSERT}
Left Arrow {LEFT}
Num Lock {NUMLOCK}
Page Down {PGDN}
Page Up {PGUP}
Right Arrow {RIGHT}
Scroll Lock {SCROLLLOCK}
Tab {TAB}
Up Arrow {UP}
To send one of function keys F1-F15, enclose the name of the key inside braces. For example, to send F5 use {F5}.
Note that special keywords can be used in combination with +, %, and ^. For example: %{TAB} means Alt-Tab. Also, you can send several special keys as you would send several normal keys: {UP 25} sends 25 Up arrows.
SendKeys can send keystrokes only to the currently active application. Use the AppActivate statement to activate an application.
SendKeys cannot be used to send keys to an application which was not designed to run under Windows.
Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.