Re: Reading Russian text in Word2003 VBA code

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Klaus Linke (info_at_fotosatz-kaufmann.de.no.junk)
Date: 07/24/04

  • Next message: Bruce: "word"
    Date: Sun, 25 Jul 2004 00:40:15 +0200
    
    

    Hi Dave,

    Likely, your string contains the correct cyrillic string, but the control
    or editor you display it in can't deal with Unicode.
    The VBA editor, immediate window or a MsgBox will display question marks
    for characters that aren't in the code page they are set up for.

    Put the string somewhere in a document (say, Selection.InsertAfter
    gsContentTr), and it'll probably show fine.

    Whether the database can deal with Unicode, or the mechanism that you use
    to connect with the database, is another question :-/

    Regards,
    Klaus

    "Dave Farmer" <anonymous@discussions.microsoft.com> schrieb im Newsbeitrag
    news:21e1301c45d13$5c40f820$a601280a@phx.gbl...
    > Hi,
    >
    > I have a vba application in Word 2003 (running on XP) that
    > reads text from named form fields as so:
    >
    > Selection.GoTo what:=wdGoToBookmark, Name:=CStr(f1name)
    > gsContentTr = Selection.Text
    >
    > where f1name is the name of the form field I'm looking for.
    >
    > The purpose of the application is to load translations
    > into a SQL server database. The code looks for the
    > correctly named field in the document (which has been sent
    > out for translation by an agency), reads the text and
    > loads it into the database.
    >
    > It works fine for French, German, Spanish etc. but for
    > Russian all I get is "???????". This is at the
    > Selection.Text stage (investigating through debug, the
    > entire selection object has none of the Russian characters
    > anywhere, just question marks), so it appears that vba as
    > it is installed on my PC cannot interpret those characters.
    >
    > I have installed Office support for the Russian language
    > via Microsoft Office 2003 Tools Language Settings, but to
    > no avail.
    >
    > Can anyone help? Is this a limitation of VBA itself, or
    > can I do something that will allow the reading of cyrillic
    > characters?
    >
    > Cheers,
    >
    > Dave.


  • Next message: Bruce: "word"

    Relevant Pages

    • Possible "bug" found in gnatcoll-sql_impl.adb
      ... I end up with more characters than I've bargained for. ... I end up with Peter in the database. ... extra single quotes added to all my string data. ...
      (comp.lang.ada)
    • Re: Importing a large amount of data as 1 line string
      ... the contents of a file into a VBA string. ... linebreak every 80 characters and leave the original file as a backup. ... The data is mixed text and numeric so I need the data type as ...
      (microsoft.public.access.externaldata)
    • Re: Byte Array to String
      ... retrieved text will mismatch the original characters. ... I think VBA may use the default system locale to ... encoding the characters. ... Dim strFileData as String ...
      (microsoft.public.dotnet.framework.aspnet)
    • Re: Generate Unique Identifier
      ... following fruit: ... Alphanumeric Code like I mentioned which is 6 Characters wide and on each ... I want convert a String in a Database to a six digit Alphanumeric Code, ...
      (microsoft.public.vb.general.discussion)
    • Re: DB2 UTF-8 ODBC double conversion
      ... UTF-8 *is* Unicode. ... byte to store characters in the 7-bit ASCII code. ... If I give a UTF-8 string to CreateFile, ... this means that everyone who is using that database has to understand that the ...
      (microsoft.public.vc.mfc)