30.6. Communicating via SendKeys

The SendKeys statement is a basic and limited form of communication with other applications. You may find SendKeys useful if neither Automation nor DDE works with the target application.

SendKeys sends the specified keystrokes to the destination application. For example, to use SendKeys to send the command to create a new file in Notepad, you send the keystrokes for Alt+F, N (to execute the File New command), and Notepad reacts as if you had pressed the keys manually. Interestingly, Alt+F also works in many Vista applications; in Office 2007 applications, Alt+F imitates clicking the Office button, for example. ...

Get Mastering VBA for Microsoft Office 2007, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.