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

Setting Denominator Depth Spacing in the Equation Editor

How to change the distance between a fraction bar and the baseline of the number below it.

Discover More

Removing HTTP from URLs

Having problems when it comes to replacing information in URLs? You're not the only one; it can be confusing making mass ...

Discover More

Pulling All Hyperlinks

Word allows you to add hyperlinks to your document. If your document includes quite a few hyperlinks, you may want a way ...

Discover More

Learning Made Easy! Quickly teach yourself how to format, publish, and share your content using Word 2013. With Step by Step, you set the pace, building and practicing the skills you need, just when you need them! Check out Microsoft Word 2013 Step by Step today!

More WordTips (ribbon)

Deriving an Absolute Value

Want to know the absolute value of a number? It's easy to derive in VBA by using the Abs function.

Discover More

Saving Changes when Closing

If you write a macro that makes changes to a document, you may want that macro to save those changes. There are several ...

Discover More

Determining a Random Value

If you need to determine a random value in a macro, you can do so using the Rnd function. This tip presents the syntax ...

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 1 + 1?

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.