To: A.V. Kokin,
Sub KokinFonts()
Dim aFont As Variant
For Each aFont In FontNames
With Selection
.Font.Name = aFont
.TypeText Text:=aFont & vbTab & "qwertyuiopasdf+ 1234567890=" &
vbCr
End With
Next aFont
End Sub
If you want two tabs add: & vbTab
For what its worth, see the following macro:
'
' List All Fonts: creates a new blank document & a table,
' and then inserts a sample of each available font.
'
Sub ListAllFonts()
Dim Index As Integer
Dim oTable As Table
Dim oRange As Range
Dim newDoc As Document
Dim nFonts As Long
Dim ptWidth As Single
Application.ScreenUpdating = False
nFonts = FontNames.count
Set newDoc = Documents.Add
With newDoc.PageSetup
ptWidth = PicasToPoints(51) - (.RightMargin + .LeftMargin)
End With
Set oTable = newDoc.Tables.Add(Selection.Range, nFonts + 1, 2)
With oTable
.Borders.Enable = False
.Range.Cells.VerticalAlignment = wdCellAlignVerticalCenter
.rows.AllowBreakAcrossPages = False
.TopPadding = PicasToPoints(0.5)
.BottomPadding = PicasToPoints(0.5)
.Columns(1).PreferredWidth = ptWidth * 0.35
.Columns(2).PreferredWidth = ptWidth * 0.65
End With
With oTable.Cell(1, 1).Range
.Font.Name = "Arial"
.Font.Bold = True
.InsertAfter "Font Name"
End With
With oTable.Cell(1, 2).Range
.Font.Name = "Arial"
.Font.Bold = True
.InsertAfter "Font Example"
End With
For Index = 1 To nFonts
Application.StatusBar = "Adding " & nFonts & " Fonts to Table: " &
Index
With oTable.Cell(Index + 1, 1).Range
.Font.Name = "Arial"
.Font.Size = 12
.InsertAfter FontNames(Index)
End With
With oTable.Cell(Index + 1, 2).Range
.Font.Name = FontNames(Index)
.Font.Size = 12
.LanguageID = wdNoProofing
.InsertAfter "ABCDEFGHIJKLMNOPQRSTUVWXYZ" _
& vbCr & "abcdefghijklmnopqrstuvwxyz" _
& vbCr & "0123456789" _
& vbCr & "!#?$%&*()[]<>{}"
.ParagraphFormat.LineSpacingRule = wdLineSpaceSingle
End With
Next Index
oTable.Sort SortOrder:=wdSortOrderAscending
Set oRange = newDoc.Range.Sections(1).Headers(wdHeaderFooterPrimary).Range
newDoc.Fields.Add Range:=oRange, Type:=wdFieldPage
newDoc.Range.Sections(1).Headers(wdHeaderFooterPrimary).PageNumbers(1).Alignment = wdAlignPageNumberCenter
Application.ScreenUpdating = True
newDoc.Range(0, 0).Select
ActiveWindow.View.Type = wdPrintView
ActiveWindow.View.Zoom.PageFit = wdPageFitBestFit
End Sub
Steven Craig Miller