|
#1
|
|||
|
|||
General Question on List of Font Names
Hello
Has Anyone got an idea that The List of Font.Names on MS-Word Document in Home Button and Userform.Textbox.Font.Names are Equal or is the List of Font Names limited in userform.Textbox. So Basicially How many Font Names will be there in Word Document against the Font Names available in Userform. Textbox or Is the List equal Does this to depend on MS-Office Version and Window versions too ? Or is the same for all the MS-Office and Windows versions How is this like ? Because on basis of above I was planning to upload dropdown with all the Font Names in Combobox ? Thanks and Regards SamD |
#2
|
||||
|
||||
How are you adding the names to the listbox.
Try the following which adds all the font names to the list box ListBox1. On my PC the count is 660 fonts. Code:
Private Sub UserForm_Initialize() Dim arrFonts As Variant Dim lng_Index As Long With ListBox1 .Clear ReDim arrFonts(Application.FontNames.Count - 1) For lng_Index = 0 To Application.FontNames.Count - 1 arrFonts(lng_Index) = Application.FontNames(lng_Index + 1) Next lng_Index SortArray arrFonts .List = arrFonts MsgBox .ListCount End With End Sub Private Function SortArray(Arr As Variant) As Variant Dim i As Long Dim j As Long Dim Temp As Variant For i = LBound(Arr) To UBound(Arr) - 1 For j = i + 1 To UBound(Arr) If UCase(Arr(i)) > UCase(Arr(j)) Then Temp = Arr(j) Arr(j) = Arr(i) Arr(i) = Temp End If Next j Next i SortArray = Arr End Function
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
|||
|
|||
GMayor
Indeed Quick response Instead of Listbox I've used Combobox. Hope you dont mind Quote:
Quote:
Quote:
SamD |
#4
|
||||
|
||||
The home tab lists the fonts the current printer is able to print.
The macro lists all the installed fonts.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#5
|
|||
|
|||
Quote:
So any Particular macro to get only list of Home Tab Fonts Why you got 660 count and why i got 160 count. Is it b'cos ComboBox has limitation SamD |
#6
|
||||
|
||||
It's because I have more fonts installed.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#7
|
|||
|
|||
Quote:
SamD |
#8
|
||||
|
||||
Sam
Fonts can come from a variety of sources and there is no reason why you would need the same list of fonts that Graham has unless you are sharing files with him and have included the whole gamut in a document. A well designed document shouldn't actually use more than one or two typefaces so it is highly unlikely that you NEED 600+ fonts. Loading hundreds of fonts you will never use is also not advised as it makes life more difficult and potentially slows applications down (eg opening the app or displaying available fonts).
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#9
|
||||
|
||||
I would go further.You simply don't need that many fonts. The only reason I have so many is that they are often installed with assorted software regardless of whether you actually want them or not and also with various language versions of Windows.
I rarely use more than four fonts in any normal circumstances. One day I may get round to removing some of the unused ones, no doubt to find that some software doesn't work properly without them, but I am sure I could manage with standard fonts Calibri, Times New Roman and Tahoma (which I use for my userforms). For Word projects it is best to declare which standard fonts (if you want the project to be widely used) are available to that project.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#10
|
||||
|
||||
You can usually find all the installed fonts in:
C:\Windows\Fonts My system lists 225. However that isn't the same as the number of font files, as Windows often has as many as four font files per font - regular, bold, italic, and bold italic.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#11
|
|||
|
|||
Thank you very much GMayor for the macro and suggestions
Thank you Andrew and Paul for your Input and suggestions After going through your suggestions Now I will not install more fonts. Though MS-Word has 160 for me. More than Enough Thank you once more SamD |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
General question about forms | JGilrain | Word | 6 | 03-15-2019 07:14 AM |
General Question | Magdalen | Word | 3 | 02-09-2018 07:05 AM |
2 general question about coding | puff | Excel Programming | 1 | 12-07-2017 08:53 AM |
Excel General Question | Excel#1 | Excel | 1 | 07-09-2015 11:16 PM |
General VBA Question | velohead | Word VBA | 0 | 07-05-2010 10:41 PM |