Written by Allen Wyatt (last updated April 18, 2023)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and 2021
When writing macros, 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.
Note:
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (12314) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and 2021. You can find a version of this tip for the older menu interface of Word here: Determining an ANSI Value.
The First and Last Word on Word! Bestselling For Dummies author Dan Gookin puts his usual fun and friendly candor back to work to show you how to navigate Word 2019. Spend more time working and less time trying to figure it all out! Check out Word 2019 For Dummies today!
Saving a document in a different format is easy if you are manually using the Save As command. Saving a document in an ...
Discover MoreNeed to know if a number in a macro is odd or even? It's easy to figure out with the simple calculation shown in this tip.
Discover MoreProgram a macro, and you can easily find that some lines get very long. If you want to shorten the lines so they are more ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)
Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.
Visit the WordTips channel on YouTube
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2025 Sharon Parq Associates, Inc.
Comments