WD: SendKeys Key Code for a Space Character Undocumented

ID: Q58000


The information in this article applies to:
  • Microsoft Word for Windows, versions 1.0, 1.1, 1.1a, 2.0, 2.0a, 2.0a-CD, 2.0b, 2.0c, 6.0, 6.0a, 6.0c
  • Microsoft Word for Windows NT, version 6.0
  • Microsoft Word for Windows 95, versions 7.0, 7.0a
  • Microsoft Word for the Macintosh, versions 6.0, 6.0.1


SUMMARY

When using the SendKeys macro command to indicate a space, use braces surrounding a space as follows:

SendKeys "{ }"


MORE INFORMATION

This key code is not documented in the "Microsoft Word for Windows Technical Reference."

All keyboard ASCII/ANSI equivalent values can be used inside {} in order to produce the keyboard character. For example

SendKeys "{32}"
can also be use to send a space character, and
SendKeys "{13}"
can be used to send the ENTER key.

Additional query words: function

Keywords : kbmacroexample winword ntword macword word6 word7 word95
Version : MACINTOSH:6.0,6.0.1; WINDOWS:1.0,1.1,1.1a,2.0,2.0a,2.0a-CD,2.0b,2.0c,6.0,6.0a,6.0c,7.0,7.0a; winnt:6.0
Platform : MACINTOSH WINDOWS winnt
Issue type : kbinfo


Last Reviewed: December 22, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.