SendKeys Method

Use the SendKeys method to send a key command to a control. See the Sample Automation for an example using the SendKeys method.

The SendKeys method has two parameters as shown in the design block below:

Use the Keys parameter to send key values or commands:

Key

Code

Shift

+

Ctrl

^

Alt

%

Use the Focus parameter to specify whether the control should receive focus when the key or command is sent. This parameter is usually set to True to focus the control.