Results 1 to 12 of 12
  1. #1
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Accented European and Hewbrew characters (W2000 SR1a)

    I have a macro that assigns string constants to text variables with the syntax

    <pre> txtLang(9) = Array("Safety", "Sicherheit", "Seguran

  2. #2
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Accented European and Hewbrew characters (W2000 SR1a)

    To illustrate the problem more clearly I am going to try the following...

    Create a short Macro

    <pre>Sub test()
    Dim txtTemp As String
    txtTemp = "

  3. #3
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Accented European and Hewbrew characters (W2000 SR1a)

    Hi Stuart,

    I think the VBA editor doesn't support Unicode. And even the upper 128 ANSI characters will be in danger if you transfer code to versions with different code pages.

    The workaround would be to use ChrW(232) and ChrW(233) instead of

  4. #4
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Accented European and Hewbrew characters (W2000 SR1a)

    Unicode I can manage without - by refusing to deal with those languages, which doesn't make me too popular.

    I guess I can implement your work around, but at great loss of maintainability. At the moment I define an array of translations for each of the dozens of words I may need to use. This makes it very easy to add languages or make changes.

    If I have to use a syntax like
    <font color=blue>txt = Array("high", Chrw(233) & "l" & Chrw(232) & "v" & Chrw(233), </font color=blue>etc.
    It's going to be a pig to find spelling errors or to add stuff compared to
    <font color=blue>txt = Array("high", "

  5. #5
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Accented European and Hewbrew characters (W200

    I confess I'm a bit rusty on what you can and can't do in Word's flavour of VBA, but is there any way you can store your sequence of arrays in a document/table outside of the VBE and then call its contents? (It might even make the spell checking easier.) HTH
    Gre

  6. #6
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Accented European and Hewbrew characters (W200

    I thought about this one for a while. I was worrying about what might happen if the **** end-user managed to delete the separate document with the language translations. OR they just managed to misfile it.

    Then I had this inspiration. I could store it in the Global Template that the Macro is running from. This would have the advantage of always being available when the Macro is running. A little play in the VBE suggests that opening <font color=blue>Application.VBE.ActiveVBProject.FileNam e</font color=blue> will give me access to the file that the Macro is stored in. I guess it's time for a significant re-write.

    StuartR

  7. #7
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Accented European and Hewbrew characters (W200

    As long as you are in the VBE, you'll run into the problem again if you transfer your project to a machine that uses a hebrew (or russian...) code page, I guess.

    Since a resource dll would be too complicated (at least for me), I'd probably try to manage the strings in a separate Unicode text file (unfortunately, PrivateProfileString/*.ini-files don't seem to support Unicode, either).

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>Klaus

  8. #8
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Accented European and Hewbrew characters (W200

    Just wondering: are you saying that the VBE will reinterpret the contents of an array that is passed to it? I thought Stuart's initial symptoms were that the code ran independently of the machine's code pages; unless the machine was forced to reinterpret the code. If I use code to cut and paste Cyrillic, the end result will still be Cyrillic not Western characters. (I will try to test tomorrow.) I agree that he should run a sample test with his Israeli colleague before devoting significant resources.
    Gre

  9. #9
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Accented European and Hewbrew characters (W200

    Perhaps I misunderstood Stuart, but I had the impression that he still plans to put the strings in a macro file that's handled by the VBE.

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>Klaus

  10. #10
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Accented European and Hewbrew characters (W2000 SR1a)

    <img src=/S/blush.gif border=0 alt=blush width=15 height=15>Sorry, it's probably much easier to fix than I thought. If you don't need Hebrew characters at all:

    In the VB editor, go into Tools > Options, and change from the font with Hebrew code page to one with Western or Middle European code page.

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>Klaus

  11. #11
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Accented European and Hewbrew characters (W200

    Don't know if this is relevant, but since moving to Word 2000, we've put all of our translations (20 languages including Cyrillic and asian characters, though not Hebrew) into an Access database (which is hidden from the users), and haven't had any problems with characters morphing. The literal characters themselves never show their face in the VBE.

    Gary

  12. #12
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Accented European and Hewbrew characters (W2000 SR1a)

    Thank you for all the suggestions and comments. <img src=/S/clever.gif border=0 alt=clever width=15 height=15>

    I now have a "workaround", but I really don't understand it! <img src=/S/confused.gif border=0 alt=confused width=15 height=20>

    I looked at Tools => Options whilst editing the problem template and it showed Courier New (Western).

    I then attempted to cut the template down to a minimal example that I could post here and it turns out that if I make ANY change to the Macro then it reverts to displaying text as ISO Latin-1 again. Interestingly the change has to be actually inside a Macro. I tried adding an extra comment in between some Public declarations and the first function and it had no effect. Inserting a comment (no text just a <font color=blue>'</font color=blue> ) within the body of any function or sub was enough! Even deleting a character from within a comment fixed it <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

    I have no idea how I missed this before, but it leaves me in control again - users who edit the macros are on their own! <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

    Unfortunately no one pays me to write VBA, I used to produce some Macros to save myself some time and they kind of spread - but the idea of having to produce hidden access databases and then distribute and manage them scared the *** out of me.

    Thank you again for the stimulating responses - they all helped. <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23>

    StuartR

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •