Font name in listbox

  • Thread starter Thread starter Eldon Lehman
  • Start date Start date
E

Eldon Lehman

Using Office Professional 97, 2000, XP running on Win XP Home, 2000
Professional, and XP Professional respectively, each preform
similarly.
How can the font name be changed for a listbox on a form? I have tried
the code for initializing the userform1 with
==Begin Code==
Private Sub UserForm_Initialize()
ListBox1.Font.Name = "Chemistry SanSerif"
With ListBox1
.AddItem "CuSO4" & Chr(215)
End With
End Sub
==End code==

Have also set the font properties in the listbox1 properties in the
VBE.

Neither make a change in the font when it is run. The font is a True
Type font installed in the fonts folder.
Also, when using the character map that comes with PPTools, the
character code is recorded in the macro recorder as
Selection.TextRange.InsertSymbol FontName:="Chemistry SansSerif",
CharNumber:=61588, Unicode:=msoTrue
The character code is shown to be "0x94". Is the a work around to use
this in the & Chr(XXX) & catenation and assign a character set?

Thank you,
Eldon Lehman
 
Eldon,
For Unicode values use ChrW instead of Chr

AddItem "CuSO4" & ChrW(61588)
 
Thank you Shyam. This opens a host of possibilities now that I know
how to enter the code. Is there a convenient keystroke such as the
Alt+0215 in the slide edit view? I understand that it can be selected,
copied, and pasted from the character map, but the keyboard path is
really nice.
Also, is there a global way of having the listbox1 have the font name
changed?
Thanks again,
Eldon
 
Back
Top