Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / December 2006

Tip: Looking for answers? Try searching our database.

How to read UTF-8 chars using VBA

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MSK - 05 Dec 2006 10:10 GMT
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.
Klaus Linke - 05 Dec 2006 17:10 GMT
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

> Hi,
>
[quoted text clipped - 15 lines]
> Many thanks.
> MSK.
Tony Jollans - 06 Dec 2006 19:46 GMT
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.

Signature

Enjoy,
Tony

> Hi,
>
[quoted text clipped - 15 lines]
> Many thanks.
> MSK.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.