Converting to Lowercase and Small Caps

Written by Allen Wyatt (last updated March 25, 2023)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, Word in Microsoft 365, and 2021


2

Marcela has a document in which there are many instances of phrases such as "century XXI" where the only thing that changes is the Roman numerals. She would like all instances of Roman numerals following the word "century" to be converted to lowercase small caps. (This is necessary so that the small caps look correct.) Marcela wonders if there is a way to do this using Find and Replace.

When you format text as small caps, anything that is a capital letter looks the same as the unformatted version of the text. Anything that is lowercase, however, looks like a "small" version of a capital letter. Thus, the name small caps. (See Figure 1.)

Figure 1. Text showing effect of small caps on uppercase and lowercase letters (XXI).

This difference in how uppercase and lowercase is displayed by small caps is why Marcela indicated that she needed to both convert the Roman numerals to lowercase and format them as small caps.

Unfortunately, there is no ability within Find and Replace to change the case of letters. You can easily use a wildcard search to apply the Small Caps attribute to the Roman numerals, but not to change them to lowercase. In order to do that, you will need to use a macro:

Sub ConvertRomans()
    Dim aRange As Range

    Set aRange = ActiveDocument.Range
    With aRange.Find
        .ClearFormatting
        .MatchWildcards = True
        .Text = "century [MDCLXVI]{1,}>"
        Do While .Execute
            With aRange
                .MoveStart Unit:=wdWord, Count:=1
                .Text = LCase(aRange.Text)
                .Font.SmallCaps = True
                .Collapse direction:=wdCollapseEnd
            End With
        Loop
    End With
End Sub

This macro uses a wildcard search to find any instances of "century" followed by Roman numerals. If an instance is located, then the word "century" is excluded from the range that was found, meaning that only the Roman numerals remain. These are then converted to lowercase and the Small Caps attribute applied. The search continues, until such point as nothing more is found. (The macro runs very quickly, even in large documents.)

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (7853) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, Word in Microsoft 365, and 2021.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Moving to the Start or End of the Real Document

The main body of your text is only one part of what makes up the entire document. Documents can consist of other ...

Discover More

Printing Reversed Images

Ever need to print the mirror image of your document? This tip explains how to reverse your image so it can be used for ...

Discover More

Summing Based on Part of the Information in a Cell

Excel provides a variety of tools that allow you to perform operations on your data based upon the characteristics of ...

Discover More

Do More in Less Time! Are you ready to harness the full power of Word 2013 to create professional documents? In this comprehensive guide you'll learn the skills and techniques for efficiently building the documents you need for your professional and your personal life. Check out Word 2013 In Depth today!

More WordTips (ribbon)

Creating a Directory

Need to create a directory from within a macro? You can do it using a single command line, as detailed in this tip.

Discover More

Determining a Paragraph's Style in VBA

When processing a document via a macro, it is often helpful to understand what style has been applied to a paragraph. You ...

Discover More

Converting Numbers to Strings

VBA is great at working with both strings and numbers. At some point, you may have a number you need to convert to a ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 2 + 2?

2023-03-25 23:45:41

Tomek

Correction to my post of 2023-03-25 23:42:01: In the search term there is no space in the front; I replaced it with < for more robustness.


2023-03-25 23:42:01

Tomek

In case the macro based solution is not acceptable, (e.g., when the IT department blocks macros), may be the following approach would work :
1. Press Ctrl+H. Word displays the Replace tab of the Find and Replace dialog box.
2. Select the Find Tab.
3. In Find What: box type in "<[MDCLXVI]{1,}>" (without quotation marks, note the space in the front).
4. Check the "Use Wildcards" box.
5. Click on the button "Find In ▼" and select "Main Document". (see Figure 1 below) . This will select all occurrences of roman numerals (in capital letters, and separated from the text by spaces or other word delimiters; this is because of < and > in the find term.
6. Close the Find Dialog box.
7. Use the keyboard shortcut Shift-F3 to convert all the selected pieces of text to lowercase.
8. While the roman numerals are still selected, press Ctrl-D (or select Font down-arrow from the Home Tab on the ribbon). In the Font dialog box, select the Small caps check-box and clickOK.

That should do it. It looks harder in description than it really is.

NOTE: This approach depends on the roman numerals being capitalized and looking like a word. Beware, the process will convert some all-capitalized words, like MIX, CIVIL, MILD, etc., and in particular I into small caps. The last one (I) should be caught by the spelling checker though. For the rest of potential words, you may want to review for them while the affected text is still highlighted. Alternatively you may search for
"century [MDCLXVI]{1,}>", change it all into lowercase (Shift-F3 twice), and Small caps, then search for all occurrences of the word "century" and revert to normal font.

Figure 1. 


This Site

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.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.