Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Converting Text to Uppercase in a Macro.
Written by Allen Wyatt (last updated September 5, 2020)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365
There are two ways you can convert text to uppercase in Word, within a macro. The first is to use the AllCaps property and the second is to use the Case property. The following shows how to use both methods.
Selection.Font.AllCaps = True Selection.Range.Case = wdUpperCase
Both of these statements assume you have selected the text to be changed prior to issuing the statements. The difference between them is that the AllCaps property controls only the formatting of the text—it only appears as uppercase. The Case property, on the other hand, actually changes the letters in the selection so they are uppercase.
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 (9354) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365. You can find a version of this tip for the older menu interface of Word here: Converting Text to Uppercase in a Macro.
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 2013. Spend more time working and less time trying to figure it all out! Check out Word 2013 For Dummies today!
Program 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 MoreWriting macros often involves selecting different parts of your document so that some sort of processing can be ...
Discover MoreFormulas created in a macro have a specific order in which operations are performed. This is known as precedence, as ...
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 © 2024 Sharon Parq Associates, Inc.
Comments