Send Keys

 

Top  Previous  Next

 

One or more characters represent each key.  To specify a single keyboard character, use the character itself.  For example, to represent the letter A, use "a" for keytext.  If you want to represent more than one character, append each additional character to the one preceding it.  To represent the letters A, B, and C, use "ABC" for keytext.

The plus sign (+), percent sign (%), tilde (~), and parentheses () have special meanings to SendKeys.  To specify one of these characters, enclose it inside braces.  For example, to specify the plus sign, use {+}.  Brackets ([ ]) have no special meaning to SendKeys, but you must enclose them in braces as well, because in other applications for Microsoft Windows brackets do have special meaning that may be significant when dynamic data exchange (DDE) occurs.  To send brace characters use { { } and { } }.

 

To specify characters that aren't displayed when you press a key (such as ENTER or TAB) and keys that represent actions rather than characters, use the codes shown below.

Key


Code


Key


Code


BACKSPACE


{BAKSPACE} or {BS} or {BKSP}


BREAK


{BREAK}


CAPS LOCK


{CAPSLOCK}


CLEAR


{CLEAR}


DEL


{DELETE} or {DEL}


DOWN ARROW


{DOWN}


END


{END}


ENTER


{ENTER} or ~


ESC


{ESCAPE} or {ESC}


HELP


{HELP}


HOME


{HOME}


INS


{INSERT}


LEFT ARROW


{LEFT}


NUM LOCK


{NUMLOCK}


PAGE DOWN


{PGDN}


PAGE UP


{PGUP}


PRINT SCREEN


{PRTSC}


RIGHT ARROW


{RIGHT}


SCROLL LOCK


{SCROLLLOCK}


TAB



UP ARROW


{UP}


F1


{F1}


F2


{F2}


F3


{F3}


F4


{F4}


F5


{F5}


F6


{F6}


F7


{F7}


F8


{F8}


F9


{F9}


F10


{F10}


F11


{F11}


F12


{F12}


F13


{F13}


F14


{F14}


F15


{F15}


F16


{F16}