ACC: Using SendKeys to Change Option MenusLast reviewed: April 3, 1997Article ID: Q101074 |
The information in this article applies to:
SUMMARYModerate: Requires basic macro, coding, and interoperability skills. In a Microsoft Access macro, a SendKeys action must precede the DoMenuItem action when you need to send keystrokes to a dialog window. For example, when a DoMenuItem action opens the Print dialog to change a printing parameter, the SendKeys keystrokes remain in the buffer and do not run if the SendKeys action follows the DoMenuItem action.
MORE INFORMATIONBecause opening a dialog window suspends a macro, you must execute the SendKeys action before the dialog opens. The following example demonstrates opening the Print dialog. Try running this macro from a button on a form.
In Microsoft Access 97
Macro Name Action Comment --------------------------------------------------------------- TestSendKeys SendKeys Store keystrokes for Print dialog RunCommand Open Print dialog TestSendKeys Actions ---------------------------- SendKeys Keystrokes: %g1%t5{ENTER} Wait: No RunCommand Command: Print In Microsoft Access 7.0
Macro Name Action Comment --------------------------------------------------------------- TestSendKeys SendKeys Store keystrokes for Print dialog DoMenuItem Open Print dialog TestSendKeys Actions ---------------------------- SendKeys Keystrokes: %g1%t5{ENTER} Wait: No DoMenuItem Menu Bar: Form Menu Name: File Menu Command: Print In Microsoft Access 1.x and 2.0
Macro Name Action Comment --------------------------------------------------------------- TestSendKeys SendKeys Store keystrokes for Print dialog DoMenuItem Open Print dialog TestSendKeys Actions ---------------------------- SendKeys Keystrokes: %p1%t5{ENTER} Wait: No DoMenuItem Menu Bar: Form Menu Name: File Menu Command: Print REFERENCESFor more information about SendKeys, search the Help Index for "SendKeys action." For more information about SendKeys keystroke syntax, search the Help Index for "SendKeys statement." |
Keywords : kbusage McrActn
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |