Problem with "localization"

A

ajdus

Hi,
I have problem with my template and localization. I made my templat
with form in my regional settings which are "slovak" and when I chang
my regional setting and all language settings to russian and I want t
take some strings from form to my document, specific slovak char lik
š, č, í etc. display in Russian alphabet (in form are displaye
normal in slovak), but others display normal . When I write a text t
this document all is allright. I thing that the problem can be wit
String and text coding in Visual Basic. Can you help me, how to set th
default language for template to slovak or solve this problem
 
C

Cindy M -WordMVP-

Hi Ajdus,
I have problem with my template and localization. I made my template
with form in my regional settings which are "slovak" and when I change
my regional setting and all language settings to russian and I want to
take some strings from form to my document, specific slovak char like
š, č, í etc. display in Russian alphabet (in form are displayed
normal in slovak), but others display normal . When I write a text to
this document all is allright. I thing that the problem can be with
String and text coding in Visual Basic. Can you help me, how to set the
default language for template to slovak or solve this problem ?
I hope I'm understanding the problem. Let me repeat and tell me if I get
it right:

You have a template with UserForm (VBA form). You want to use this with
two languages: Slovak and Russian. The problem is that when you open the
form, created in Slovak, in a Russian-language interface, some of the
characters display in Slovak?

For this kind of localization, I think the best thing would be to write
the labels and any other text on the form at run-time (in other words, NO
defaults). A UserForm has an Initialize event where you can put (or call)
the code to write these things before the form becomes visible to the
user.

Check the language (Application.LanguageID) using Select Case and branch
accordingly.

Many people store "language strings" in outside files, such as an XML or
INI file. This makes it easier to maintain if things change often. But
you can also hard-code it right into your VBA, if that seems appropriate
to you.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
A

ajdus

Thanx for reply, but my problem isn't that when I open the
form, created in Slovak, in a Russian-language interface, some of the
characters display in Slovak, but that when I open the document whic
are open from this form (this document represent address book) and
choose some addresses (this are automaticaly copied to my new opene
document from template), some characters (which are specific for m
language, like č,š,í) are displayed in Russian alphabe
(cyrilic or azbuka) but others characters (like a,b,c,d...) ar
displayed normal in slovak. I need to everything have to be displaye
in slovak in any regional setting. That´s why I want to selec
default language. I have this addresses (language strings) in outsid
file, problem is only when I have Russian interface and when this ar
copied like strings in VB from address book to my document
 
C

Cindy M.

Hi Ajdus,
Thanx for reply, but my problem isn't that when I open the
form, created in Slovak, in a Russian-language interface, some of the
characters display in Slovak, but that when I open the document which
are open from this form (this document represent address book) and I
choose some addresses (this are automaticaly copied to my new opened
document from template), some characters (which are specific for my
language, like č,š,í) are displayed in Russian alphabet
(cyrilic or azbuka) but others characters (like a,b,c,d...) are
displayed normal in slovak. I need to everything have to be displayed
in slovak in any regional setting. That´s why I want to select
default language. I have this addresses (language strings) in outside
file, problem is only when I have Russian interface and when this are
copied like strings in VB from address book to my document.
"Default language" in Word is a slippery thing. As far as Word's
internal language goes, how that's described in detail in the Tips
section of my website.

After working through that you'll realize that, if you change the
Windows language, you're going to have trouble with the language of a
new document in Word. Rather than copying/pasting from the "address
book" document, you might try using the FormattedText property of the
Range object, instead. If necessary, apply the required language
formatting, as well. Something along these lines:
Dim rngTarget as Word.Range 'where the address should be "pasted"
Dim rngSource as Word.Range 'the address you're importing

Set rngTarget = Selection.Range 'for example
Set rngSource = AddressDoc.Bookmarks("abc").Range 'for example
rngTarget.FormattedText = rngSource.FormattedText
rngTarget.LanguageID = wdSlovak

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 
A

ajdus

I am going to study your site :). i found, that my problem is wit
encoding that text and setings of code page to use. I must solve it no
:(
 

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