Bookshelf Home | Contents | Index | PDF |
Siebel VB Language Reference > VB Language Reference > SendKeys StatementThis standard VB statement sends keystrokes to an active Windows application. Syntax
ReturnsUsageThe keystrokes are represented by characters of string. The default value for wait is 0 (FALSE). To specify an alphanumeric character, enter it in string. For example, to send the character a, use To specify that the SHIFT, ALT, or CTRL key should be pressed simultaneously with a character, prefix the character with Parentheses can be used to specify that the SHIFT, ALT, or CTRL key should be pressed with a group of characters. For example, The following characters must be enclosed in braces if they are to be understood as literal characters by SendKeys; otherwise they have specific meanings as follows: For example, a string equal to Use To send the same key several times, enclose the character in braces and specify the number of keys sent after a space. For example, use To send one of the nonprintable keys, use a special keyword inside braces: To send one of the function keys (F1 to F15), simply enclose the name of the key inside braces. For example, to send F5, use Note that special keywords can be used in combination with +, %, and ^. For example, SendKeys can send keystrokes only to the currently active application. Therefore, you have to use the AppActivate statement to activate an application before sending keys (unless it is already active). SendKeys cannot be used to send keys to an application that was not designed to run under Windows. ExampleThis example starts the Windows Phone Dialer application and dials a phone number entered by the user. Sub Button_Click See Also |
Siebel VB Language Reference |