WD: How to Determine ASCII Value of Any Character

Last reviewed: February 2, 1998
Article ID: Q27885
The information in this article applies to:
  • Microsoft Word for the Macintosh, versions 3.0, 3.01, 3.02, 4.0, 5.0, 5.1, 6.0, 6.0.1, 6.0.1a
  • Microsoft Word for Windows, versions 6.0, 6.0a, 6.0c
  • Microsoft Word for Windows 95, versions 7.0, 7.0a

SUMMARY

Word for Windows 6.x, Word for the Macintosh 6.x

In Word, you can find the ASCII value of any single character by selecting the character and then running the following macro.

   Sub Main
      Rem The symbol must be selected before running the macro.
      AsciiVal$ = Str$(Asc(Selection$())
      MsgBox "The ASCII value is " + AsciiVal$
   End Sub

NOTE: You can use this macro in Word for Windows, versions 6.x or 7.x. However, if the character was inserted using the Symbol dialog box (Insert menu) the value returned is always incorrect. If the symbol was inserted using Character Map, the macro returns the correct ASCII value

Word for the Macintosh 5.x

In Word for the Macintosh, versions 5.0 and 5.1, the Symbol command is used for determining the ASCII value of a character. To use the Symbol command, do the following:

  1. From the Insert menu, choose Symbol.

  2. From the Font menu, choose the desired font and size.

  3. Find the desired character in the table and click on the character once.

NOTE: If the Symbol command is installed, and COMMAND+OPTION+Q is pressed, a table of all available characters for that font are displayed. If the desired character is found, press the symbol to insert that character into the document. In the lower left hand corner of the symbol window will be the ASCII equivalent as well as the keystrokes needed to produce the character if the character is a printable character.

If the Symbol command is not installed, COMMAND+OPTION+Q will work as described below for Word versions 4.0 and 3.0x.

Word for the Macintosh 3.0, 4.0

In Microsoft Word for the Macintosh, versions 3.0 or 4.0, you can find the ASCII value of any single character by selecting the character and then pressing COMMAND+OPTION+Q. The ASCII value then appears in the lower-left corner of the window.

If you do not select any text, or if you select more than one character, the lower-left corner prompts you with "Code." You can then type in a specific ASCII value (integer) and press the RETURN key on the main keyboard or the ENTER key on the numeric keypad to insert the character with that value.

MORE INFORMATION

Once you use the "Paste Special Character" command by pressing COMMAND+OPTION+Q, you can repeat the action by clicking the lower-left corner. This is true of any special procedures that use the lower-left corner. Other special procedures include "Apply Style Name" (COMMAND+SHIFT+S), "Change Font" (COMMAND+SHIFT+E), "Insert Glossary Text" (COMMAND+BACKSPACE or DELETE).


Additional query words: forty
Keywords : kbfont kbhowto macword winword word7 word95
Version : WINDOWS:6.0,6.0a,6.0c,7.0,7.0a; MACINTOSH:3.0,3.01,3.02,4.0,5.0,5.10,6.0,6.0.1,6.0.1a
Platform : MACINTOSH WINDOWS
Issue type : kbhowto kbinfo


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 2, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.