
Tips.Net > WordTips Home > Macros > Converting Text to Uppercase in a Macro
Summary: The VBA macro language includes the ability to modify the capitalization of a text selection. There are two ways to perform this conversion, as you discover in this tip. (This tip works with Microsoft Word 97, Word 2000, Word 2002, and Word 2003.)
There are two ways you can convert text to uppercase in Word. 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.
Tip #1723 applies to Microsoft Word versions: 97 2000 2002 2003
Save Time! You can have this tip (and several hundred just like it) in the WordTips annual archives. Imagine having over 400 tips available at your fingertips, in each annual volume.
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
Beauty Tips
Bugs and Pests Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Organizing Tips
Pet Tips
Word2007 Tips
WordTips