Troubleshooting – Word Fails to Show Font Name and Other Formatting Values – Shows Blank Fields

You may sometimes need to find out whether your text or part of it is formatted with the same font, font size, paragraph style or other formatting properties. This can be as easy as selecting the text in question and checking which values Word shows for the properties in question. But it may not always work as you want or expect.

This article explains the rules that apply to the way Word shows or does not show formatting information. You will also find suggested solutions plus a macro that can automatically perform the check for you, also when Word fails to do so.

Summary of rules - 
when does Word show formatting values and when not?

If you are only interested in the rules that apply to Word’s display of formatting property values for selected text - without all the details - here they are:

  • RULE NO. 1
    In general, Word will show a specific paragraph or character property value as long as the same value applies to the entire selection.
  • RULE NO. 2
    In general, a blank field, a gray check box or the text (No color) in a color field indicate that different formatting property values have been applied to different parts of the selection.
  • RULE NO. 3
    Word stops showing paragraph formatting property values when the number of selected paragraphs exceeds 49.
  • RULE NO. 4
    Word stops showing character formatting property values when the number of selected paragraphs exceeds 50.

Rules no. 3 and 4 are based on the results I have found by testing. Microsoft has confirmed that it works that way "by design".

Read on for more details about how it works.

About paragraph and character formatting

When talking about formatting of text in Word, you will often need to distinguish between formatting of entire paragraphs and formatting of characters.

Any paragraph in a Word document is applied a paragraph style (paragraph formatting). On top of the paragraph style, the entire paragraph or part of it may be applied a character style (character formatting). Paragraph and character formatting may also be applied as direct formatting by selecting text and applying special formatting to the selection.

There are several places in Word where you can see which paragraph and character property values have been applied to the selected text. Examples are the Font field and the Font Size field on the Home tab and the information in the Paragraph and Font dialog boxes. The Paragraph dialog box lets you set paragraph properties. The Font dialog box lets you set character properties.

The rules that apply to Word’s display of formatting property values - details

According to my testing, the four rules below apply to the way Word displays paragraph and character formatting values.

The rules seem to apply to all versions of Word. I have tested in Word 2003, Word 2007, Word 2010, Word 2013, and Word 2016 / Word for Office 365.

No doubt that the described behavior makes it more difficult to check the formatting in some situations. But then the macro you can download from this page may be useful.

  • RULE NO. 1
    In general, Word will show a specific paragraph or character property value as long as the same value applies to the entire selection.

See Figure 3, Figure 5, and Figure 7 below.

See also the comments about theme fonts below Figure 7.

  • RULE NO. 2
    In general, a blank field, a gray check box or the text (No color) in a color field indicate that different formatting property values have been applied to different parts of the selection.

See Figure 4 and Figure 6 below.

For example, the font name Calibri will be shown in the Font field on the Home tab if all text in the selection is formatted with the font Calibri. But the Font field will be blank if different fonts are used.

However, the general rules above do not always apply. There are more rules.

  • RULE NO. 3
    Word stops showing paragraph formatting property values when the number of selected paragraphs exceeds 49.

This is true even if the selection has been applied the same paragraph property value (e.g. the same paragraph style or the same line spacing). The display of values stops as soon as any part of paragraph 50 is included in the selection.

See Figure 4 below.

Note that VBA also returns a blank string or another undefined value if checking a paragraph formatting property of a selection that includes more than 49 paragraphs. The display of values stops as soon as any part of paragraph 51 is included in the selection.

Example - checking the following VBA-code in the macro editor:

Selection.Range.ParagraphFormat.Style

will return an empty string instead of a paragraph style name if more than 49 paragraphs are selected.

It does not matter whether all of or some of the selected paragraphs are in e.g. a table. It is the total number of paragraphs that are partly or fully included in the selection that matters. For more details, see How word counts selected paragraphs - special cases and oddities below.

See Figure 1-2 below for illustrations of the display results with 49, 50, and 51 selected paragraphs, respectively.

  • RULE NO. 4
    Word stops showing the character formatting property values when the number of selected paragraphs exceeds 50.

This is true even if the selection has been applied the same character property value (e.g. the same font or the same font size).

See Figure 6 below.

Note that VBA also returns a blank string or another undefined value if checking a character formatting property of a selection that includes more than 50 paragraphs.

Example - checking the following VBA-code in the macro editor:

Selection.Font.Name

will return an empty string instead of a font name if more than 50 paragraphs are selected.

It does not matter whether all of or some of the selected paragraphs are in e.g. a table. It is the total number of paragraphs that are partly or fully included in the selection that matters. For more details, see How word counts selected paragraphs - special cases and oddities below.

See Figure 1-2 below for illustrations of the display results with 49, 50, and 51 selected paragraphs, respectively.

Illustrations of paragraph and character values you will see depending on the number of selected paragraphs

49, 50, and 51 selected paragraphs

Figure 1. (1), (2), and (3) shows 49, 50, and 51 selected paragraphs, respectively. The gray color shows the selection. In Figure 2 below you will see examples of which information Word displays.

The displayed style, font and font size info

Figure 2. (1), (2), and (3) relate to the corresponding numbers in Figure 1 above and illustrate what Word displays in StyleFont, and Font Size fields that have been added to the Quick Access Toolbar (QAT). Note that the results comply with the rules described above: Style is a paragraph property in this case (the selected paragraphs have not been applied a character style in this case) - it shows no values if more than 49 paragraphs are selected (rule no. 3). Font and Font Size are character properties - they show no values if more than 50 paragraphs are selected (rule no. 4).

Special case: If the entire selection had been applied a character style on top of the paragraph style, the Style field would have shown the name of the character style instead of the paragraph style. Since Word's limit for showing character properties is 50 (rule no. 4) and not 49 (rule no. 3), such character style name would have been shown in (2) above (50 paragraphs selected) instead of a blank Style field.

Illustrations of paragraph property display in the Paragraph dialog box

Paragraph dialog box showing all values

Figure 3. Paragraph dialog box showing all values. See rule no. 1 above.

Paragraph dialog box showing blank and grayed out values only

Figure 4. Paragraph dialog box showing blank and grayed out values only. See rules no. 2 and 3 above.

Illustrations of character property display in the Font dialog box

Font dialog box showing all values

Figure 5. Font dialog box showing all values. See rule no. 1 above.

Font dialog box showing blank and grayed out values only

Figure 6. Font dialog box showing blank and grayed out values only. See rules no. 2 and 4 above.

Special case of font value in the Font dialog box

Figure 7. Special case of font value in the Font dialog box. Note that the Font field shows +Body and note the text marked by orange near the bottom of the dialog box. See the explanation below.

Font inherited from theme versus font set directly

  • +Body is shown for text with outline level Body Text if the font in use is based on the document’s theme font for Body Text. Correspondingly, +Headings is shown for text formatted with e.g. one of the built-in Heading 1-9 styles if the font in use is based on the document’s theme font for Headings.

The Font field on the Home tab shows the font name followed by (Body)or (Headings) in those situations, for example Arial (Body).

  • When it comes to the display of a font property value, Word will consider a specific font to be the same no matter whether or not it is inherited from a theme. This means that the Font field will not be blank even if the selection contains a mixture of the two.

Example: The theme font for Body Text is Arial. Two paragraphs are selected, one that uses the font from the theme and shows Arial (Body) in the Font field and one that has been applied the font directly and shows Arial in the Font field. When selecting both paragraphs, the Font field will not be blank but show the font name from the topmost of the two paragraphs. See Figure 8 below.

Font name with and without (Body)

The following VBA code will return Arial in both situations:

Selection.Font.Name

Figure 8. Value in Font field if both theme font and non-theme font is used in selection. The gray color shows the selection.

What you can do if you see blank formatting property values - 
incl. macro solution

Solution 1 - select fewer paragraphs at a time

If blank formatting property values are caused by the number of selected paragraphs exceeding the limits of 49 or 50 as described in rules no. 3 and 4 above, try to change the selection so it includes fewer paragraphs. Perform the checks you need. Change the selection to include the next chunk of paragraphs and repeat the checks as many times as needed.

If you have not selected more than 49 paragraphs, a blank field, a grayed out check box or (No color) indicate that the selection does include mixed formatting property values.

See also How word counts selected paragraphs - special cases and oddities below.

Solution 2 - use a macro to check the formatting

I have created a macro you can use to check the selection for the following three formatting properties:

  • Font name
  • Font size
  • Paragraph style

The macro works on any number of paragraphs. Note however, that the more paragraphs you have selected, the longer the check may take. It should take only a few seconds to check e.g. 100 paragraphs.

The dialog box that opens when you start the macro

Figure 9. The dialog box that opens when you start the macro.

The macro is not meant to cover everything but it may help you in your work.

The main purpose of the macro is to make it easy to detect whether or not the same font, font size, and/or paragraph style have been applied to the entire selection. As rules no. 3 and 4 tell, Word will not provide that information if your selection includes more than 49 or 50 paragraphs.

The macro compares the font name, font size, and paragraph style of each paragraph in the selection with the values applied to the start of selection. A message shows the resulting values when finished.

  • If a value is the same for the entire selection, the exact value will be shown.
  • If a value deviates, [Mixed values] will be shown. Extra information will be shown if the selection includes tables and/or shapes.

See the examples below.

Example of final result after running the macro - identical formatting property values were found in the entire selection

Figure 10. Example of final result after running the macro - identical formatting property values were found in the entire selection.

Examples of final result after running the macro - mixed formatting property values were found in the selection

Figure 11. Examples of final result after running the macro - mixed formatting property values were found in the selection.

More details and considerations about the macro

  • The macro includes comments that explain what is going on.
  • The macro could be extended to check for more formatting properties.
  • It might seem smarter and faster to check the selection in chunks of 49 paragraphs at a time instead of checking each individual paragraph. However, since the initial selection to be checked may contain all kinds of content, this could cause problems.

The macro

Below, you will find the macro code. If you need help on installing macros, see How to install a macro.

Option Explicit


Sub CheckFormattingOfSelection_FontName_FontSize_ParagraphStyle()

'=========================
'Macro created 2018 by Lene Fredborg, DocTools - www.thedoctools.com
'THIS MACRO IS COPYRIGHT. YOU ARE WELCOME TO USE THE MACRO BUT YOU MUST KEEP THE LINE ABOVE.
'YOU ARE NOT ALLOWED TO PUBLISH THE MACRO AS YOUR OWN, IN WHOLE OR IN PART.
'=========================
'Before running the macro, select the paragraphs you want to check
'The macro checks font name, font size, and paragraph style of all paragraphs in the selection
'A message shows the resulting values when finished
'If a value is the same for the entire selection, the exact value will be shown
'If a value deviates, '[Mixed values]' will be shown
'NOTE: The result may not be accurate if the selection contains e.g. inline shapes or floating shapes
'The source document remains unchanged
'NOTE: If values deviate, the check will stop as soon as all three values are found to deviate
'=========================

    Dim rngToCheck As Range
    Dim oPara As Paragraph
    Dim lngPara As Long
    Dim lngParasSelected As Long

    Dim strFontName_First As String
    Dim lngFontSize_First As Long
    Dim strStyleParagraph_First As String

    Dim strFontName As String
    Dim lngFontSize As Long
    Dim strStyleParagraph As String

    Dim strMsg As String

    Const strTitle As String = "Check Font Name, Font Size, Paragraph Style of Selection"
    Const strMsgMixed As String = "[Mixed values]"

    On Error GoTo ErrorHandler

    lngParasSelected = Selection.Paragraphs.Count
    
    strMsg = "The selection includes " & lngParasSelected & " paragraph(s)." & vbCr & vbCr & _
        "You can use this command to check whether the same font, font size, and paragraph style have been " & _
        "applied to the entire selection." & vbCr & vbCr & _
        "The Status Bar will show the progress." & vbCr & vbCr & _
        "NOTE: The more paragraphs you have selected, the longer the check may take. " & _
        "If needed, you can stop the check by pressing Ctrl+Break and clicking End in the dialog box that opens."
    
    If MsgBox(strMsg, vbOKCancel, strTitle) <> vbOK Then
        GoTo ExitHere
    End If

    Set rngToCheck = Selection.Range
    'Even if the code does not change the display in Word, it may speed up things
    'turning off Application.ScreenUpdating
    Application.ScreenUpdating = False
    System.Cursor = wdCursorWait
    
    'Initialize values
    lngPara = 0
    
    With rngToCheck
        'Store data for first paragraph - used for comparison during check
        strFontName_First = .Characters.First.Font.Name
        lngFontSize_First = .Characters.First.Font.Size
        strStyleParagraph_First = .Paragraphs.First.Range.ParagraphFormat.Style
    End With
    
    strFontName = strFontName_First
    lngFontSize = lngFontSize_First
    strStyleParagraph = strStyleParagraph_First

    'Show info in the Status Bar
    Application.StatusBar = "Checking formatting of paragraphs. Please wait..."
    
    For Each oPara In rngToCheck.Paragraphs
        With oPara.Range
            lngPara = lngPara + 1
            
            'Show info in Status Bar - update for every 20 paragraphs only
            If lngPara Mod 20 = 0 Then
                Application.StatusBar = "Checking formatting of paragraph " & lngPara & " of " & lngParasSelected & ". Please wait..."
            End If
            
            'The end of row marker in table rows includes a paragraph that is to be ignored
            'Skip in case of an end of cell marker in a table
            If .Tables.Count > 0 Then
                If .Cells.Count = 0 Then
                    'Paragraphs is end of row marker
                    GoTo SkipParagraph
                End If
            End If
            a
            'Check whether font name, font size, paragraph style is the same as is _First
            'If a value deviates from _First, store a value to keep track of this and do not check that type anymore

            'If strFontName has been set to "" then do not check
            If strFontName <> "" Then
                If .Font.Name = strFontName_First Then
                    strFontName = strFontName_First
                Else
                    'Set value to "" and do not check more
                    strFontName = ""
                End If
            End If

            'If lngFontSize has been set to 0 then do not check
            If lngFontSize <> 0 Then
                If .Font.Size = lngFontSize_First Then
                    lngFontSize = lngFontSize_First
                Else
                    lngFontSize = 0
                End If
            End If

            'If strStyleParagraph has been set to "" then do not check
            If strStyleParagraph <> "" Then
                'Style is nothing if mixed
                If .ParagraphFormat.Style Is Nothing Then
                    strStyleParagraph = ""
                Else
                    'If same as strStyleParagraph_First
                    If .ParagraphFormat.Style = strStyleParagraph_First Then
                        strStyleParagraph = strStyleParagraph_First
                    Else
                        strStyleParagraph = ""
                    End If
                End If
            Else
                strStyleParagraph = ""
            End If
        End With

        'Stop all checks if all values now deviate from _First
        If strFontName = "" And lngFontSize = 0 And strStyleParagraph = "" Then
            Exit For
        End If
SkipParagraph:
    Next oPara

    'Even if the selection isn't changed by the code, Word tends to lose it
    'Make sure original selection is selected
    rngToCheck.Select

    Application.ScreenUpdating = True
    System.Cursor = wdCursorNormal
    Application.StatusBar = ""
    
    'Show msg with result
    strMsg = "Finished checking the selected " & lngParasSelected & " paragraph(s)." & vbCr & vbCr

    'Append info about end of row paragraphs if the selection includes table(s)
    With rngToCheck
        'Append info about end of row paragraphs if relevant
        If .Tables.Count > 0 Then
            strMsg = strMsg & "NOTE ABOUT TABLES: The selection includes table row(s). All table rows end with an end of row marker that includes a paragraph mark. " & _
                "Such end of row marker paragraphs are included in the total count of selected paragraphs above but they were ignored during the check." & vbCr & vbCr
        End If

        'Append info about shapes and inline shapes if relevant
        If .ShapeRange.Count > 0 Or .InlineShapes.Count > 0 Then
            strMsg = strMsg & "NOTE ABOUT SHAPES: The selection includes one or more shapes that may contain text. The values below may not be correct, e.g. if text is found inside shapes that are nested inside other shapes." & vbCr & vbCr
        End If
    End With

    'Append further general info
    strMsg = strMsg & "If a value is the same for the entire selection, that specific value is shown. Otherwise, '" & strMsgMixed & "' is shown." & vbCr & vbCr & _
             "The following values apply to the selection:" & vbCr & vbCr

    'Append font name info
    If strFontName = "" Then
        strMsg = strMsg & "Font name:" & vbTab & strMsgMixed & vbCr
    Else
        strMsg = strMsg & "Font name:" & vbTab & strFontName & vbCr
    End If

    'Append font size info
    If lngFontSize = 0 Then
        strMsg = strMsg & "Font size:" & vbTab & strMsgMixed & vbCr
    Else
        strMsg = strMsg & "Font size:" & vbTab & lngFontSize & vbCr
    End If

    'Append style info
    If strStyleParagraph = "" Then
        strMsg = strMsg & "Paragraph style:" & vbTab & strMsgMixed & vbCr
    Else
        strMsg = strMsg & "Paragraph style:" & vbTab & strStyleParagraph & vbCr
    End If

    'Show msg
    MsgBox strMsg, vbOKOnly, strTitle

ExitHere:
    Set rngToCheck = Nothing
    Application.ScreenUpdating = True
    System.Cursor = wdCursorNormal
    Application.StatusBar = ""

    Exit Sub
    '=========================
ErrorHandler:
    MsgBox "An error occurred during the check.", vbOKOnly + vbExclamation, "Error - " & strTitle
    Resume ExitHere
End Sub

How word counts selected paragraphs - special cases and oddities

The Word Count dialog box does not include all selected paragraphs in the count but VBA counts all paragraphs

There are some oddities when it comes to the count of paragraphs Word shows in the Word Count dialog box.

If you check the number of selected paragraphs in the Word Count dialog box and compare it with the number found via VBA, you will see that Word does not always show the same result.

  • Word ignores some types of selected paragraphs in the result shown in the Word Count dialog box. The main principle is that that the dialog box counts only paragraphs that are visible when formatting marks are turned off. However, see the details below.
  • All selected paragraphs are counted when checking via VBA.

IMPORTANT: The limits of 49 and 50 paragraphs described in rules no. 3 and 4 above are based on all paragraphs in the selection being counted, i.e. the number that will be returned when using the following VBA code:

Selection.Paragraphs.Count

About special paragraphs in tables

If you turn on formatting marks (Ctrl+Shift+8) in Word, a paragraph will, in general, end with a Pilcrow Sign, ¶. But tables are special as described below.

  • All table cells end with an end of cell marker that includes a paragraph mark.
  • All table rows end with an end of row marker that includes a paragraph mark.
  • When checking via VBA, both an end of cell marker and an end of row marker consists of two characters: Chr(13) + Chr(7). Chr(13) is a normal paragraph mark. Even if you turn on formatting marks, you will not see those special paragraph marks as Pilcrow Signs, ¶. They are invisibly included in the marker which appears as a Currency Sign, ¤.

Types of paragraphs that are ignored by the Word Count dialog box

Some types of paragraphs seem to always be ignored in the count of paragraphs shown in the Word Count dialog box. I have found the following rules:

  • Empty paragraphs, i.e. paragraphs that consist of a paragraph mark only (may include non-printing characters like spaces and tabs too), are not included in the paragraph count in the Word Count dialog box.
  • Empty end of cell marker paragraphs in tables, i.e. paragraphs that consist of an end of cell marker only (may include non-printing characters like spaces and tabs too), are not included in the paragraph count in the Word Count dialog box.
  • If the selection includes the last paragraph in the document. that paragraph is not included in the paragraph count in the Word Count dialog box even if the paragraph contains text or other content.
  • End of row marker paragraphs are not included in the paragraph count in the Word Count dialog box.

As mentioned above, VBA counts all paragraphs.

The illustrations below show examples of the different results of paragraph count in the Word Count dialog box and in VBA.

VBA result in this example:

Selection.Paragraphs.Count = 6

Figure 12. Word and VBA results - counting selected paragraphs - empty table cells. The gray color shows the selection.

Word and VBA results - counting selected paragraphs - including a cell with a single paragraph

VBA result in this example:

Selection.Paragraphs.Count = 6

Figure 13. Word and VBA results - counting selected paragraphs - including a cell with a single paragraph. The gray color shows the selection.

Word and VBA results - counting selected paragraphs - including a cell with two paragraphs but only one with text

VBA result in this example:

Selection.Paragraphs.Count = 7

Figure 14. Word and VBA results - counting selected paragraphs - including a cell with two paragraphs but only one with text. The gray color shows the selection.

Related information

See About VBA Macros and Code Snippets and How to Install a Macro for misc. information that may help you in your work with macros and for information about how to install macros.