Thread: [Solved] Using font name as a field
View Single Post
 
Old 10-21-2018, 07:56 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

The following macro, originally published by MS, will print a list of all installed fonts, including the same sample text for each. You could modify the '.InsertAfter' string to include some representative boilerplate text - even including a page break so that each font is output to a new page. The macro could also be modified to employ only a designated set of fonts.
Code:
Sub ListFonts()
Application.ScreenUpdating = False
Dim ListFont As Variant
With ActiveDocument.Characters
  For Each ListFont In FontNames
    With .Last
      .Font.Name = "Arial"
      .Font.Size = 12
      .Text = ListFont & Chr(11)
    End With
    With .Last
      .Font.Name = ListFont
      .InsertAfter "ABCDEFGHIJKLMNOPQRSTUVWXYZ ~!@#$%^&*()_+|<>?:{}" & Chr(11) & _
        "abcdefghijklmnopqrstuvwxyz `1234567890-=\,.;'[]" & vbCr
    End With
    With .Last
      .Font.Name = "Arial"
      .InsertAfter vbCr
    End With
  Next ListFont
End With
Application.ScreenUpdating = True
End Sub
For PC macro installation & usage instructions, see: http://www.gmayor.com/installing_macro.htm
For Mac macro installation & usage instructions, see: https://wordmvp.com/Mac/InstallMacro.html
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote