Is it possible in VBA to store a Symbol Font (i.e. Wingdings) character
within a String variable?
For example, would it be possible to replace the "?" character in the code
below with a Windings character (like no 34 the "simely face")?
dim A as String
A = "Some ordinary text here, followed by " & "?"
Any help will be much appreciated.
RPJ
Klaus Linke - 20 Jul 2007 01:39 GMT
> Is it possible in VBA to store a Symbol Font (i.e. Wingdings) character
> within a String variable?
[quoted text clipped - 4 lines]
> dim A as String
> A = "Some ordinary text here, followed by " & "?"
No... The character code using the Wingdings (Symbol) font would be &HF000 +
74 = &HF04A = 61514. But there's no way to specify the font in the string
variable.
But the smiley face also is contained in lots of regular fonts such as
Arial, and has the code U+263A.
You'd use A = "some text" & ChrW(&H263A)
It's easiest to avoid symbol fonts as much as possible, or put another way,
to use Unicode whenever possible.
Regards,
Klaus
Russ - 22 Jul 2007 09:30 GMT
You can store almost anything in an autotext entry and use vba code to place
it where you want. To see the code, try recording a macro while inserting an
autotext entry manually and revise the code as needed.
> Is it possible in VBA to store a Symbol Font (i.e. Wingdings) character
> within a String variable?
[quoted text clipped - 8 lines]
>
> RPJ

Signature
Russ
drsmN0SPAMikleAThotmailD0Tcom.INVALID