Hi,
Word uses the "private area" Unicode block starting at U+F000 for symbol
fonts.
The text doesn't actually consist of question marks -- You only get "?"
because neither the VBA editor nor Message boxes can deal with Unicode.
If you have some string with symbols in it and want to have the characters
as you typed them in on the keyboard (= map the codes to the 1-byte codes
below 256 that were used in pre-Unicode times), you could use something like
Dim i As Long
Dim myString As String
myString = Selection.Text
For i = 1 To Len(myString)
Select Case AscW(Mid(myString, i, 1))
Case &HF000 To &HF0FF
Mid(myString, i, 1) = _
ChrW(AscW(Mid(myString, i, 1)) - &HF000)
End Select
Next i
MsgBox myString
Or you can get the code of some selected symbol with
? AscW(Selection.Text) And &HFFFF&
(... the "And &HFFFF&" is needed because AscW returns a signed integer, and
you get negative numbers between &H7FFF and &HFFFF, so you convert it to a
Long variable with 4 bytes instead of 2, and mask the upper 2 bytes)
Or if you prefer a string with the hex number:
? Hex(AscW(Selection.Text))
Regards,
Klaus
> Hello,
>
[quoted text clipped - 8 lines]
>
> Thanks.
An Hong Phan - 14 Jul 2005 19:35 GMT
Thank you very much!!! That's exactly what I'd need to do.
You saved my day.
Thanks,
- An H. Phan -
> Hi,
>
[quoted text clipped - 47 lines]
>>
>> Thanks.