Finding a Change in Typeface

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


Derek needs a way to find, in a document, the next time the typeface (font name) changes. For instance, if the insertion point is within the middle of the document, he would like Word to let him know, starting at that point, where the next change occurs. Derek wonders if there is a way to accomplish such a task.

There is no built-in way to accomplish this task, though you may be able to visually tell when the typeface has changed. I can often tell by simply increasing the zoom factor for the document (say, to 200% or 250%) and then visually scanning the document to look for changes in appearance. Of course, this will depend on the visual disparity between the two adjacent fonts.

If you prefer a macro-based solution, you could create one that saves the typeface name at the current insertion point location and then steps through each remaining character of the document. If the typeface differs from the original one, then you can notify the user. Here is an example of such a macro:

Sub ChangeOfFont()
    Dim fntName As String
    Dim aRange As Range

    Set aRange = Selection.Range
    aRange.Collapse Direction:=wdCollapseStart
    aRange.MoveEnd Unit:=wdCharacter
    fntName = aRange.Font.Name
    Do
        aRange.MoveEnd Unit:=wdCharacter
        aRange.MoveStart Unit:=wdCharacter
    Loop Until aRange.Font.Name <> fntName Or _
      aRange.Bookmarks.Exists("\EndOfDoc")
    aRange.Select
    If aRange.Bookmarks.Exists("\EndOfDoc") Then
        MsgBox "End of document"
    Else
        MsgBox "Font change from " & fntName & " to " & aRange.Font.Name
    End If
End Sub

The majority of work is done in the Do loop, where each character's font is checked to see if it has changed. Note that the loop also checks to see if the end of the document is reached, at which point you would want the macro to stop.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (5131) 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

Printing Summary Information

Word automatically maintains a number of properties for each document you create. As part of those properties you can ...

Discover More

Stopping Date Parsing when Opening a CSV File

Excel tries to make sense out of any data that you import from a non-Excel file. Sometimes this can have unwanted ...

Discover More

Checking for the Existence of a File

The data stored in a worksheet can often correspond to information external to that worksheet. For instance, you might ...

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)

Determining the Number of Fonts Available

When creating a macro, you may need to figure out how many fonts are available to Word. You can do this using the ...

Discover More

Writing a Macro from Scratch

Creating macros can help extend what you can do in Word. If you work with macros, you know that creating macros from ...

Discover More

Modifying Behavior of the Open Dialog Box

The Open dialog box is one that few of us think about, but you can control how it behaves with a little bit of macro ...

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 two more than 7?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


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.