Page 153 - Microsoft Office Excel 2003 Programming Inside Out
P. 153

Part 3:  The Excel Object Mode
                                                     The Application Object

                             Table 6-3.  Key Codes
                             Key                         Key Code
                             Delete or Del               {Delete} or {Del}
                             Down Arrow                  {Down}
                             End                         {End}
                             Enter                       ~ (Tilde)
                             Enter (Numeric Keypad)      {Enter}
                             F1 through F15              {F1} through {F15}
                             Help                        {Help}
                             Home                        {Home}
                             Insert or Ins               {Insert}
                             Left Arrow                  {Left}
                             Num Lock                    {NumLock}
                             Page Down                   {PGDN}
                             Page Up                     {PGUP}
                             Return                      {Return}
                             Right Arrow                 {Right}
                             Scroll Lock                 {ScrollLock}
                             Tab                         {Tab}
                             Up Arrow                    {Up}
                             Key Modifier                Key Code
                             Shift                       + (Plus Sign)
                             Ctrl                        ^ (Caret)
                             Alt                         %  (Percent Sign)

                             SendKeys Method

                             The SendKeys method allows you to send keystrokes to the keyboard buffer for when you
                             need to send keystrokes to the current application. This can be especially useful if you know
                             your procedure will cause a dialog box to open and there is no method to prevent the dialog
                             box from appearing and waiting on user input.
                             The syntax for the SendKeys method is

                             expression.SendKeys (Keys, Wait)

                               ●  expression  is an optional expression that returns an Application object.
                               ●	 Keys  is a required variant expression, usually expressed as a string, that contains the   Chapter 6
                                  key codes you want to send. (See Table 6-3 for a list of key codes for special keys.)



                                                                                                       127
   148   149   150   151   152   153   154   155   156   157   158