Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Font Index Numbers
I work in an office that does custom embroidery and logo, and I sometimes
recieve artwork without a font-name attached and I need to figure out which font is being used. I have a cell ("a3") with the name I am trying to match example ("Choir") and I have two buttons, next and last, i need to be able to change to the next available font, or the last depending on the button i press. I know how to change the fonts using the selection.font.name="Fontname" Method but I need to know if it is possible to use a number for the fonts or if there is a fontindex that returns the name of the fonts available???? Tia ben |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Font Index Numbers
oddly enough i answered my own question looking through other posts, if
anyone else has this question goto http://www.oaltd.co.uk/Excel/SBXLPage.asp and download the getfonts.zip file thanks "ben" wrote: I work in an office that does custom embroidery and logo, and I sometimes recieve artwork without a font-name attached and I need to figure out which font is being used. I have a cell ("a3") with the name I am trying to match example ("Choir") and I have two buttons, next and last, i need to be able to change to the next available font, or the last depending on the button i press. I know how to change the fonts using the selection.font.name="Fontname" Method but I need to know if it is possible to use a number for the fonts or if there is a fontindex that returns the name of the fonts available???? Tia ben |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Font Index Numbers
sorry guys one other thing i found out, if you are running windows xp or
possible even windows 2000 with a new versin of character map there is more than one drop down box so you need to paste this code over top of the one on in vb 'Looking for ComboBox, or no more windows i = 0 Do Until (Left(sBuff, x) = "ComboBox" And i = 2) Or hWndChild = 0 If Left(sBuff, x) = "ComboBox" Then i = i + 1 hWndChild = GetWindow32(hWndChild, GW_HWNDNEXT) x = GetClassName32(hWndChild, sBuff, 128) Loop just find that comment in vb and paste over all the way down to the loop this will give you the contents of the correct box "ben" wrote: oddly enough i answered my own question looking through other posts, if anyone else has this question goto http://www.oaltd.co.uk/Excel/SBXLPage.asp and download the getfonts.zip file thanks "ben" wrote: I work in an office that does custom embroidery and logo, and I sometimes recieve artwork without a font-name attached and I need to figure out which font is being used. I have a cell ("a3") with the name I am trying to match example ("Choir") and I have two buttons, next and last, i need to be able to change to the next available font, or the last depending on the button i press. I know how to change the fonts using the selection.font.name="Fontname" Method but I need to know if it is possible to use a number for the fonts or if there is a fontindex that returns the name of the fonts available???? Tia ben |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Font Index Numbers
Nice that you answered your own questions, and yes Excel 2000
would be using the new CharMap as I got the same results as you did. You might also take a look at Excel Developer Tip: Getting a List of Installed Fonts http://www.j-walk.com/ss/excel/tips/tip79.htm Suggest you start with an empty workbook because the number of fonts will be overwhelming, for instance I could not create a third column showing the italic version. I made a modification to show the font in column B that is indicated in column A. Sub ShowInstalledFonts() '--http://www.j-walk.com/ss/excel/tips/tip79.htm Dim Fontlist, tempbar, i As Long Set Fontlist = Application.CommandBars("Formatting").FindControl( ID:=1728) ' If Font control is missing, create a temp CommandBar If Fontlist Is Nothing Then Set tempbar = Application.CommandBars.Add Set Fontlist = tempbar.Controls.Add(ID:=1728) End If ' Put the fonts into column A Range("A:B").ClearContents Cells(1, 2) = "A stitch in time saves nine." For i = 0 To Fontlist.ListCount - 1 Cells(i + 1, 1) = Fontlist.List(i + 1) Cells(i + 1, 2).Formula = "=$B$1" Cells(i + 1, 2).Font.Name = Fontlist.List(i + 1) Next i ' Delete temp CommandBar if it exists On Error Resume Next tempbar.Delete End Sub I expect that this collection was not available when Stephen wrote his code not that it matters how you get something done. In fact when I run Stephen's code from Excel 2000 what I get is is not the list of fonts that you see in Excel, but instead:a list of character sets. (what codepages refer to) Back to the original question and non programming solutions:: As far as I know fonts are know by their names not a number, there is a number used for codepage that you do not see but that is an arrangement table for what character you will see for each of the 256 characters in a byte. Do you know about view the font list in it's own font tools, customize, options (tab), list fonts in their own font You can use the CharMap write out your phrase in characters to copy box: A stitch in time saves nine. then select the phrase, and then use the arrow key to go down through the fonts in the CharMap. --- HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvps.org/dmcritchie/excel/search.htm "ben" wrote in message ... I work in an office that does custom embroidery and logo, and I sometimes recieve artwork without a font-name attached and I need to figure out which font is being used. I have a cell ("a3") with the name I am trying to match example ("Choir") and I have two buttons, next and last, i need to be able to change to the next available font, or the last depending on the button i press. I know how to change the fonts using the selection.font.name="Fontname" Method but I need to know if it is possible to use a number for the fonts or if there is a fontindex that returns the name of the fonts available???? Tia ben |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I get a index% of two numbers when they are negative or pos | Excel Worksheet Functions | |||
Chart axes color index vs font color index | Charts and Charting in Excel | |||
How do I change the row index font? | Excel Discussion (Misc queries) | |||
Visual Basic/Excel Changing font olor index in part of a string | Excel Programming | |||
Filling a listbox depending on font index | Excel Programming |