Hi All
I have the following code which types "ABCD..." in each font type that you
have on your PC. I want to also add each font name to the generated document
next to each the corresponding line of text in that font, e.g.
ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 123456789 - Arial
Sub listfonts()
Documents.Add
For Each thisfont In FontNames
With Selection
.InsertAfter "ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
123456789" & vbCr
.MoveUp unit:=wdParagraph, Count:=1
.MoveDown unit:=wdParagraph, Count:=1, Extend:=wdExtend
.Font.Name = thisfont
.Font.Size = 10
.MoveDown unit:=wdParagraph, Count:=2
End With
Next
End Sub
Any help would be appreciated. Thanks
Helmut Weber - 11 Mar 2005 10:58 GMT
Hi Lee,
how about this one:
Dim sFnt As Variant
Dim sExm As String
Dim lPrg As Long
'sExm = "ABCDEFGHIJKLMNOPQRSTUVWXYZ "
sExm = "abcdefghijklmnopqrstuvwxyz - "
'sExm = sExm & "123456789 - "
With ActiveDocument
.Range.Delete
For Each sFnt In FontNames
.Range.InsertAfter sExm & sFnt & vbCr
lPrg = .Paragraphs.count
.Range.Paragraphs(lPrg - 1).Range.Font.Name = sFnt
Next
End With
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000
Lee - 22 Mar 2005 22:44 GMT
Thanks Helmut
Worked perfectly!
> Hi Lee,
>
[quoted text clipped - 19 lines]
> "red.sys" & chr(64) & "t-online.de"
> Word 2002, Windows 2000