
Tips.Net > WordTips Home > Macros > Creating Macros > Determining an ANSI Value
Summary: You may need to determine the numeric value of a character in a macro. You can do that using the Asc function, described in this tip. (This tip works with Microsoft Word 97, Word 2000, Word 2002, Word 2003, and Word 2007.)
You can use the Asc function to determine the ANSI value of the first letter of a string. In early versions of BASIC, Asc returned the ASCII value, but Word uses only ANSI values. The function uses the following format:
x = Asc(sMyString)
where x is the variable that the ANSI value should be assigned to, and sMyString is the string to be analyzed.
Tip #737 applies to Microsoft Word versions: 97 2000 2002 2003 2007
Take Control! Master the real power behind Word! Successfully master the secrets of powerful formatting and create documents that stand out from the rest. Best of all, you can create documents that are easy to maintain and quick to change.
Check out Word 2007 Styles and Templates today!
Add power to your purpose with Word. A comprehensive 480+ page e-book explains everything you need to know about macros. (more information...)
Ask a Word Question
Make a Comment
Bugs and Pests Tips
ExcelTips
Family Tips
Health Tips
Home Tips
Organizing Tips
WordTips