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

Conditionally Highlighting Cells Containing Formulas

Excel's conditional formatting feature allows you to create formats that are based on a wide variety of criteria. If you ...

Discover More

Checking the Scope of a Defined Name

When creating a macro to work with the names of defined ranges, you may need to know whether the scope of the name is for ...

Discover More

Best Way to Create a Document Template

Templates are the basis of creating consistent documents that permit fast and easy formatting. What is the best way to ...

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)

Keeping Documents at a Single-Page View

Word allows you to display either a single page at a time or, with larger monitors, multiple pages. If Word displays your ...

Discover More

Saving Search and Replace Information in a Macro

You may want to save a user's existing Find and Replace settings before changing them in your macro. This tip examines ...

Discover More

Changing What Is Pasted in a Dialog Box

When you record a macro, Word very literally records what you do. This includes filling in various settings in dialog ...

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 four less than 7?

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.