Word VBA Macro – Sample of a string for each font installed

22nd September, 2008 – 11:45 am

Occassionally I need a quick and dirty look at what a string will look like in various fonts.

I use this (quite hacky) VBA macro.  Be warned it can take a while to run on older systems – SAVE YOUR OPEN WORD DOCS FIRST!

Sub SampleFonts()
‘ Output a text string in each font intalled on the system
‘ Steve Morgan, www.stevemorgan.me.uk 22/09/2008

Dim fnt As Variant
Dim strOut As String

‘ Change this to change outputted string!
strOut = “My Sample Text”

For Each fnt In Application.FontNames
‘ MsgBox fnt
Selection.Font.Name = fnt
Selection.TypeText (strOut + vbTab + vbTab + fnt) + vbCrLf

Next

End Sub

  1. 2 Responses to “Word VBA Macro – Sample of a string for each font installed”

  2. This is a test comment after enabling the SpamFree plug in

    By Steve Morgan on Nov 15, 2008

  3. test – great post though. Thanks .

    By Steve Morgan on Jun 16, 2009

Post a Comment