[bump]
Thought I'd post the final version of the code I used, in case anyone was curious.
Code:
Public Sub MySymbolFonts()
' Written for TSG member Tamara1969; creates a
' document to act as a visual reference for
' symbol fonts.
Dim saFontArray() As String
Dim strFonts As String
Dim intFontCount As Integer
Dim intCharCount As Integer
' Dim lngCharCount As Long 'for unicode
' Const UNICODE_UBOUND As Long = 65536
Const ALPHA_NUMERICS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" & _
"abcdefghijklmnopqrstuvwxyz" & _
"1234567890!@#$%^&*()-=_+,./;[]\<>?:{}|`~"
strFonts = "CommercialPi BT," & _
"Marlett," & _
"MS Outlook," & _
"Symbol," & _
"UniversalMath1 BT," & _
"Webdings," & _
"Wingdings," & _
"Wingdings 2," & _
"Wingdings 3," & _
"ZapfDingbats"
saFontArray = Split(strFonts, ",")
Application.ScreenUpdating = False
With ActiveDocument
With .Paragraphs.TabStops
.Add InchesToPoints(1.25), wdAlignTabLeft
.Add InchesToPoints(2.5), wdAlignTabLeft
.Add InchesToPoints(3.75), wdAlignTabLeft
.Add InchesToPoints(5), wdAlignTabLeft
End With
.Range.Font.Name = "Courier New"
End With
' for unicode characters (pegs processor, probably causes crash)
' With ActiveDocument.Range
' .Font.Size = 14
' For intFontCount = 0 To UBound(saFontArray)
' If intFontCount > 0 Then
' .Characters(.End).InsertBreak wdPageBreak
' End If
' .Characters(.End).Font.Name = "Courier New"
' .InsertAfter "Font Name: " & saFontArray(intFontCount)
' .InsertAfter vbCr & Chr$(9)
' For lngCharCount = 33 To UNICODE_UBOUND
' If ChrW(lngCharCount) Like vbNullString Then
' Debug.Print "hit a null"
' Else
' .InsertAfter lngCharCount
' .InsertAfter " is " & ChrW(lngCharCount) & Chr$(9)
' .Characters(.End - 2).Font.Name = saFontArray(intFontCount)
' If (lngCharCount Mod 3 = 0) Then
' .InsertAfter vbCr & Chr$(9)
' End If
' End If
' Next lngCharCount
' Next intFontCount
' End With
' original way (this works).
With ActiveDocument.Range
.Font.Size = 14
For intFontCount = 0 To UBound(saFontArray)
If intFontCount > 0 Then
.Characters(.End).InsertBreak wdPageBreak
End If
.InsertAfter "Font Name: " & saFontArray(intFontCount) & vbCr
For intCharCount = 1 To Len(ALPHA_NUMERICS)
.InsertAfter Mid(ALPHA_NUMERICS, intCharCount, 1)
.InsertAfter " is " & Mid(ALPHA_NUMERICS, intCharCount, 1) & Chr$(9)
.Characters(.End - 2).Font.Name = saFontArray(intFontCount)
If (intCharCount Mod 5 = 0) Then
.InsertAfter vbCr
End If
Next intCharCount
Next intFontCount
End With
Application.ScreenRefresh
End Sub
chris.