Macro to view all fonts installed on computer?

N

Noozer

Anyone have a macro to show all the fonts installed on a PC + some sample
characters?

For example (Font names in Arial Narrow, sample in the selected font @ 8
points)

....
Arial: abcdef ABCDEF 123456 !@#$%^
Arial Black: abcdef ABCDEF 123456 !@#$%^
Arial Narrow: abcdef ABCDEF 123456 !@#$%^
....
 
E

emu

Sub ListFonts()

Dim varFont As Variant
' Speeds macro processing and suppresses display.
Application.ScreenUpdating = False
' Create new document.
Documents.Add Template:="normal"

' Loop through each available font.
For Each varFont In FontNames
With Selection
' Format for name of font.
.Font.Name = "times new roman"
.Font.Bold = True
.Font.Underline = True
' Insert Font name.
.TypeText varFont
' Insert a new paragraph after the Font Name.
.InsertParagraphAfter
' Move to the new paragraph.
.MoveDown unit:=wdParagraph, Count:=1, Extend:=wdMove
' Format for the font example.
.Font.Bold = False
.Font.Underline = False
.Font.Name = varFont
' Enter example text(Alphabetic characters.)
.TypeText "abcdefghijklmnopqrstuvwxyz"
' Insert a new paragraph.
.InsertParagraphAfter
' Move to the new paragraph.
.MoveDown unit:=wdParagraph, Count:=1, Extend:=wdMove
' Insert example text(Numeric characters.)
.TypeText "0123456789?$%&()[]*_-=+/<>"
' Insert two new paragraphs and move down.
.InsertParagraphAfter
.InsertParagraphAfter
.MoveDown unit:=wdParagraph, Count:=1, Extend:=wdMove
End With

Next varFont
Application.ScreenUpdating = True

End Sub


I think I got it from the Microsoft site at some point
 
N

Noozer

No good... Font name and sample are not on the same line. I'll see if I can
change it though...

Thx!
 
N

Noozer

emu said:
Sub ListFonts()

Dim varFont As Variant
' Speeds macro processing and suppresses display.
Application.ScreenUpdating = False
.MoveDown unit:=wdParagraph, Count:=1, Extend:=wdMove
End With

Next varFont
Application.ScreenUpdating = True

End Sub


I think I got it from the Microsoft site at some point

I was able to get it to format as I wished, but there are a couple issues...

- The fonts are not listed in alphabetical order as I expected.
- I have some fonts starting with @ that duplicate the font (ie GulimChe,
@GulimChe)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top