Use Word VBA to Display Each Font Name in Its Own Font
Question details
Create a Word VBA list of available font names, with each name displayed in its corresponding font.

- 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.
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.
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.
In Word, open Developer > Visual Basic. If the Developer tab is hidden, enable it through Word's ribbon settings.
In the VBA editor, select the document or template where you want to store the macro, then choose Insert > Module.
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
Return to Word, click where you want the list, and choose View > Macros. Select ListFontsInOwnFont and click Run.

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.

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.




