D
Dawn Bjork Buzbee
I have a macro (code below) that generates a sample of the fonts on a
specific computer. On one system, it found fonts (duplicates) with a name
that started with @ such as @Arial. This apparently sent a code to the
printer so it stopped printing from that point in the document. Once I
manually deleted those initial entries, the print job was fine.
Is there an easy way to either skip all entries with a prefix of @ or to
create a starting point in the list of fonts such as Aa?
Thank you in advance.
**START OF CODE
Dim iCharNumber As Integer, iPointSize As Integer, iNumberOfFonts As Integer
Dim vFontName As Variant, i As Integer
Dim sSortedFontNames() As String
ReDim sSortedFontNames(FontNames.Count)
On Error GoTo UserClickedCancel
' Prompt for point size of samples
iPointSize = InputBox("Print fonts at which point size (such as 12 or 14)?",
"Print Font List")
MsgBox "The creation of the print fonts list may take a few minutes-a prompt
will appear when the list is completed", vbInformation, "Please Wait"
On Error GoTo 0
i = 0
For Each vFontName In FontNames
i = i + 1
sSortedFontNames(i) = vFontName
Next vFontName
WordBasic.SortArray sSortedFontNames()
Selection.GoTo What:=wdGoToBookmark, Name:="start"
' Build list
For i = 1 To FontNames.Count
Selection.ParagraphFormat.KeepWithNext = True
Selection.Font.Size = 11
Selection.Font.Name = "Times New Roman"
Selection.TypeText sSortedFontNames(i) & " at " & iPointSize & " points:"
Selection.TypeParagraph
Selection.Font.Size = iPointSize
Selection.Font.Name = sSortedFontNames(i)
Selection.TypeText Text:="The quick brown fox jumps over the lazy dog"
Selection.TypeParagraph
For iCharNumber = 33 To 122
Selection.TypeText Chr(iCharNumber) & " "
Next iCharNumber
Selection.ParagraphFormat.KeepWithNext = False
Selection.TypeParagraph
Selection.TypeParagraph
Next i
UserClickedCancel:
**END OF CODE
Thank you for your help,
Dawn
specific computer. On one system, it found fonts (duplicates) with a name
that started with @ such as @Arial. This apparently sent a code to the
printer so it stopped printing from that point in the document. Once I
manually deleted those initial entries, the print job was fine.
Is there an easy way to either skip all entries with a prefix of @ or to
create a starting point in the list of fonts such as Aa?
Thank you in advance.
**START OF CODE
Dim iCharNumber As Integer, iPointSize As Integer, iNumberOfFonts As Integer
Dim vFontName As Variant, i As Integer
Dim sSortedFontNames() As String
ReDim sSortedFontNames(FontNames.Count)
On Error GoTo UserClickedCancel
' Prompt for point size of samples
iPointSize = InputBox("Print fonts at which point size (such as 12 or 14)?",
"Print Font List")
MsgBox "The creation of the print fonts list may take a few minutes-a prompt
will appear when the list is completed", vbInformation, "Please Wait"
On Error GoTo 0
i = 0
For Each vFontName In FontNames
i = i + 1
sSortedFontNames(i) = vFontName
Next vFontName
WordBasic.SortArray sSortedFontNames()
Selection.GoTo What:=wdGoToBookmark, Name:="start"
' Build list
For i = 1 To FontNames.Count
Selection.ParagraphFormat.KeepWithNext = True
Selection.Font.Size = 11
Selection.Font.Name = "Times New Roman"
Selection.TypeText sSortedFontNames(i) & " at " & iPointSize & " points:"
Selection.TypeParagraph
Selection.Font.Size = iPointSize
Selection.Font.Name = sSortedFontNames(i)
Selection.TypeText Text:="The quick brown fox jumps over the lazy dog"
Selection.TypeParagraph
For iCharNumber = 33 To 122
Selection.TypeText Chr(iCharNumber) & " "
Next iCharNumber
Selection.ParagraphFormat.KeepWithNext = False
Selection.TypeParagraph
Selection.TypeParagraph
Next i
UserClickedCancel:
**END OF CODE
Thank you for your help,
Dawn