Hi,

I am currently developing some Word templates (office 2003) + VBA


I have a UTF-8 encoded text file...I wanted to read and show the
values into a list box...


The charactors are getting changed while reading and filling the
control...(but in the text file they are perfect)


I tried FSO and Open statement with Line input.. I dont know how to
Convert into normal chars..


How to resovle.. ?


Its bit urgent...give me some useful links


Many thanks.
MSK.

Re: How to read UTF-8 chars using VBA by Klaus

Klaus
Tue Dec 05 11:10:39 CST 2006

The built-in list box does not support Unicode.
Haven't tried any, but this post has some pointers to Unicode-enabled
replacements:
http://www.thescripts.com/forum/thread555700.html

Regards,
Klaus


"MSK" <mannaikarthik@yahoo.com> wrote:
> Hi,
>
> I am currently developing some Word templates (office 2003) + VBA
>
>
> I have a UTF-8 encoded text file...I wanted to read and show the
> values into a list box...
>
>
> The charactors are getting changed while reading and filling the
> control...(but in the text file they are perfect)
>
>
> I tried FSO and Open statement with Line input.. I dont know how to
> Convert into normal chars..
>
>
> How to resovle.. ?
>
>
> Its bit urgent...give me some useful links
>
>
> Many thanks.
> MSK.
>



Re: How to read UTF-8 chars using VBA by Tony

Tony
Wed Dec 06 13:46:56 CST 2006

There are other ways I'm sure, but try this to get you going:

Dim File ' As ADODB.Stream
Set File = CreateObject("ADODB.Stream")
File.Open
File.Type = 2 ' adTypeText
File.Charset = "UTF-8"
File.LoadFromFile "C:\path\file.etc"
myString = File.ReadText

File.Close

It should work as is with late binding or you can early bind with a
reference to Microsoft ActiveX Data Objects 2.5 or later, and use the
commented bits.

--
Enjoy,
Tony

"MSK" <mannaikarthik@yahoo.com> wrote in message
news:1165313418.388223.300500@l12g2000cwl.googlegroups.com...
> Hi,
>
> I am currently developing some Word templates (office 2003) + VBA
>
>
> I have a UTF-8 encoded text file...I wanted to read and show the
> values into a list box...
>
>
> The charactors are getting changed while reading and filling the
> control...(but in the text file they are perfect)
>
>
> I tried FSO and Open statement with Line input.. I dont know how to
> Convert into normal chars..
>
>
> How to resovle.. ?
>
>
> Its bit urgent...give me some useful links
>
>
> Many thanks.
> MSK.
>