WD6X: MacWord Doesn't Support Selected SendKeys Keystrokes

Last reviewed: February 5, 1998
Article ID: Q118832
The information in this article applies to:
  • Microsoft Word for the Macintosh, version 6.0

SYMPTOMS

The WordBasic macro language in Word 6.0 for the Macintosh fails to send certain non-character keystrokes when using the SendKeys command.

CAUSE

Due to a system limitation, the full set of keystrokes are not supported on the Macintosh.

STATUS

Microsoft has confirmed this to be a problem in Word version 6.0 for the Macintosh. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

The following table lists non-character keys that are not available on the Macintosh when using SendKeys:

   Key                     Sendkeys parameter
   ---                     ------------------
   BACKSPACE               {backspace} or {bs} or {bksp}
   BREAK                   {break}
   CAPS LOCK               {capslock}
   CLEAR                   {clear}
   DEL                     {delete} or {del}
   DOWN ARROW              {down}
   END                     {end}
   HELP                    {help}
   HOME                    {home}
   INS                     {insert}
   LEFT ARROW              {left}
   NUM LOCK                {numlock}
   PAGE DOWN               {pgdn}
   PAGE UP                 {pgup
   PRINT SCREEN            {prtsc}
   RIGHT ARROW             {right}
   UP ARROW                {up}
   F1, F2, F3,...F16       {F1}, {F2}, {F3},...{F16}

The SendKeys command sends the keystrokes specified by the user to the next WordBasic command, just as if the characters were typed at the keyboard. SendKeys must precede instructions that activate the command that receives the keystrokes. On a Macintosh, a SendKeys instruction can send no more than 10 keystrokes and can send them only to Word. SendKeys cannot be used with another program.

The following sample macro types a file name, "TESTFILE", in the File Save As dialog box:

   Sub MAIN
   SendKeys "TESTFILE"
   Dim dlg As FileSaveAs
   x = Dialog(dlg)
   End Sub

NOTE: When stepping through a macro (using the Step or Step Subs button) that contains a SendKeys instruction, make sure SendKeys and the instruction following are on the same line, separated by a colon.

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

   http://www.microsoft.com/supportnet/refguide/ 


Additional query words: sending code sendkeys
Keywords : macword word6 kbmacro
Version : MACINTOSH:6.0, 6.0.1
Platform : MACINTOSH
Issue type : kbbug


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 5, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.