how to get central european fonts in VBA?

M

MichalS

Hello, I am having a trouble with using Polish fonts in VBA. Even using
msgbox doesnt show the expected result. Instead of the Polish characters I
get some weird signs, called commonly bushes ;-)
I know that these signs are unicode signs... this is probably the source of
the problem. So my question is how to get Polish signs in msgbox. When this
is resolved then I will be able to save such signs even to a text file...

I am looking forward to your help
best regards
MichalS
 
K

Klaus Linke

Hi Michael,

The VBA IDE can't handle Unicode. It's still using code pages.

In the VBA editor's menu, choose Tools > Options, then the second tab
(Editor Format?).

In the top right drop-down, you can choose the font and the code page.

Regards,
Klaus
 
D

Dost

Hello Klaus,

But it did not solve the problem MichalS mentioned: I have the same problem.
I need to search for charactors using InStr function, but I can not get
result for Arabic letters/ signs for example. Please help us know how to
capture arabic litters through VBA using unicode or any other way??

best regards,
Dost
 
K

Klaus Linke

Hi Dost,

Maybe I did misunderstand MichaelS's problem. There are lots of different
issues having to do with the VBA editor not supporting Unicode to Windows
message boxes using code pages and more.

If you use InStr, and the letters, you're searching for aren't in the code
page you use, you can use ChrW for each letter... say

Dim sWord As String
sWord = ChrW(&H634) & ChrW(&H643) & ChrW(&H631) & ChrW(&H639)
' Sheen + Kaf + Reh + Ain = "thanks" in Arabic (hopefully)

MsgBox InStr(1, sWord, ChrW(&H643)), vbInformation, "Position of Kaf in
sWord:"

Handling text in that form is obviously a PITA, so if you have more than a
very few arabic words to deal with, it would be easier to put them into an
Unicode text file and have the macro read them from there.

If you have more questions, there are some newsgroups that concentrate on
international issues such as microsoft.public.wird.international.features
where the gurus on localization hang out.

Regards,
Klaus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top