[tt]
Hello all, I need help with this code that I was helped with a while back and I can't remember who helped me.
What this code does is display all fonts in any system on a large table with font samples which is working great,
NOW, I would like assistance on how to make the code display the same results
ONE FONT SAMPLE PER PAGE.
******************* code ***********************
Private Sub CommandButton1_Click()
Dim oDoc As Document, SampleText As String, FontName As String, _
MyRange As Range, StartRange As Range, i As Long
Set oDoc = Documents.Add
SampleText = Chr$(147) & "ABCDEFGHIJKLMNOPQRSTUVWXYZ" & _
Chr$(148) & ", " & _
Chr$(147) & "abcdefghijklmnopqrstuvwxyz" & Chr$(148) & ", " & _
Chr$(147) & "0123456789" & Chr$(148) & ", " & _
Chr$(147) & "The quick brown fox jumps over the lazy dog" & Chr$(148) & ", " & _
Chr$(145) & "àáâéêëìíîòóôùúû" & Chr$(146) & ", " & _
Chr$(145) & "(;,.:£€$?!)" & Chr$(146)
System.Cursor = wdCursorWait
With oDoc
For i = 1 To Application.FontNames.Count
FontName = Application.FontNames(i)
StatusBar = "Inserting " & FontName
Set MyRange = .Range
With MyRange
.Collapse wdCollapseEnd
.Font.Reset
.InsertAfter FontName & vbTab
End With
Set MyRange = .Range
With MyRange
.Collapse wdCollapseEnd
Set StartRange = MyRange.Duplicate
.InsertAfter SampleText
StartRange.End = MyRange.End
StartRange.Font.Name = FontName
.InsertAfter vbCr
End With
Next i
StatusBar = "Sorting list"
.Range.Sort FieldNumber:="Paragraphs"
.Paragraphs(1).Range.Text = "Font" & vbTab & "Sample" & vbCr
StatusBar = "Converting to table"
.Range.ConvertToTable Format:=wdTableFormatClassic1, _
AutoFit:=True
With .Tables(1)
.Rows.AllowBreakAcrossPages = False
.Rows(1).HeadingFormat = True
End With
End With
With Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = ", "
.Replacement.Text = "^l"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute Replace:=wdReplaceAll
End With
System.Cursor = wdCursorNormal
End Sub
******************* code *********************
Delete * from brain Where MaxLevel = "Full" and reaction = "Slow" order by StartOver
Hello all, I need help with this code that I was helped with a while back and I can't remember who helped me.
What this code does is display all fonts in any system on a large table with font samples which is working great,
NOW, I would like assistance on how to make the code display the same results
ONE FONT SAMPLE PER PAGE.
******************* code ***********************
Private Sub CommandButton1_Click()
Dim oDoc As Document, SampleText As String, FontName As String, _
MyRange As Range, StartRange As Range, i As Long
Set oDoc = Documents.Add
SampleText = Chr$(147) & "ABCDEFGHIJKLMNOPQRSTUVWXYZ" & _
Chr$(148) & ", " & _
Chr$(147) & "abcdefghijklmnopqrstuvwxyz" & Chr$(148) & ", " & _
Chr$(147) & "0123456789" & Chr$(148) & ", " & _
Chr$(147) & "The quick brown fox jumps over the lazy dog" & Chr$(148) & ", " & _
Chr$(145) & "àáâéêëìíîòóôùúû" & Chr$(146) & ", " & _
Chr$(145) & "(;,.:£€$?!)" & Chr$(146)
System.Cursor = wdCursorWait
With oDoc
For i = 1 To Application.FontNames.Count
FontName = Application.FontNames(i)
StatusBar = "Inserting " & FontName
Set MyRange = .Range
With MyRange
.Collapse wdCollapseEnd
.Font.Reset
.InsertAfter FontName & vbTab
End With
Set MyRange = .Range
With MyRange
.Collapse wdCollapseEnd
Set StartRange = MyRange.Duplicate
.InsertAfter SampleText
StartRange.End = MyRange.End
StartRange.Font.Name = FontName
.InsertAfter vbCr
End With
Next i
StatusBar = "Sorting list"
.Range.Sort FieldNumber:="Paragraphs"
.Paragraphs(1).Range.Text = "Font" & vbTab & "Sample" & vbCr
StatusBar = "Converting to table"
.Range.ConvertToTable Format:=wdTableFormatClassic1, _
AutoFit:=True
With .Tables(1)
.Rows.AllowBreakAcrossPages = False
.Rows(1).HeadingFormat = True
End With
End With
With Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = ", "
.Replacement.Text = "^l"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute Replace:=wdReplaceAll
End With
System.Cursor = wdCursorNormal
End Sub
******************* code *********************
Delete * from brain Where MaxLevel = "Full" and reaction = "Slow" order by StartOver