If you combine this technique for transferring a collection to an array with the sort method
and the
PrintFontNamesroutine shown earlier in Listing 44.8, and put the “With Selection”
command into service, you’ll come up with the macro called PrintSortedFontNames, shown
in Listing 44.10.
Listing 44.10PrintSortedFontNamesListing
Dim i As Integer
Dim varFont As Variant
Dim strFonts() As String
Dim intPoints As Integer
Dim strTestString As String
ReDim strFonts(FontNames.Count)
intPoints = 11
intPoints = InputBox(“Print list at what point size?”, “PrintFontNames”,
➥intPoints) ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.