Office Settings & Configuration

Use Word VBA to Display Each Font Name in Its Own Font

John WilsonJohn Wilson Nov 22, 2026 868 views

Question details

Create a Word VBA list of available font names, with each name displayed in its corresponding font.

Display Each Font Name in Its Own Font Using Word VBA
Product
Microsoft Word
Device & OS
not provided
Scenario
The user is creating a font sample list with a Word VBA macro.
Observed behavior
Each listed font name should be formatted using the font it represents.
Before you start

Open a document in a desktop version of Word that supports VBA, and place the insertion point where the font list should appear. Make sure macros are permitted by your organization's security settings.

Solution 1Recommended

Set the Selection Font Before Inserting Each Name

Use Word's FontNames collection to insert each available font name in its own typeface.

The macro changes the selection's font before typing each name, so the inserted text inherits that font.

1
Open the VBA editor

In Word, open Developer > Visual Basic. If the Developer tab is hidden, enable it through Word's ribbon settings.

2
Insert a module

In the VBA editor, select the document or template where you want to store the macro, then choose Insert > Module.

3
Add the macro

Paste this code into the module: Sub ListFontsInOwnFont() Dim aFont As Variant For Each aFont In Application.FontNames Selection.Font.Name = CStr(aFont) Selection.TypeText Text:=CStr(aFont) Selection.TypeParagraph Next aFont End Sub

4
Run the macro

Return to Word, click where you want the list, and choose View > Macros. Select ListFontsInOwnFont and click Run.

Set the Selection Font Before Inserting Each Name
Font availability: The list reflects the fonts available to Word on the current device. A font that lacks characters needed for its name may display those characters using a fallback font.
Free Microsoft Office alternative

Create and Format Font Samples in WPS Writer

WPS Office is a free, lightweight alternative for creating font samples in a familiar editing interface. Open Word documents in WPS Writer for an easy transition, while checking any VBA macros separately for compatibility.

Format font names and preview typefaces in WPS WriterOpen and edit Microsoft Word DOC and DOCX filesUse a familiar ribbon-style interfaceWork with a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Why do all the font names appear in the same font?

The macro may be inserting the text without changing the selection's font first. Set Selection.Font.Name to the current font name before calling Selection.TypeText.

Where should I place the cursor before running the macro?

Click in the Word document where the list should begin, then open View > Macros and run ListFontsInOwnFont. Avoid selecting existing text unless you intend to replace it.

How can I keep the macro in my Word document?

Use File > Save As and choose a macro-enabled Word document format, such as DOCM. A standard DOCX file cannot retain VBA macros.

Will the font list look the same on another device?

Not necessarily. The other device needs the corresponding fonts installed; otherwise, Word may substitute different fonts when displaying the document.