Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to read text file that contains japanese character ?

0 views
Skip to first unread message

Postmaster

unread,
Sep 13, 2001, 12:19:51 AM9/13/01
to
Hi..

I got problem when read a text file that contain japanese characters. I
create this text file by using OutputTo method for export
my access report that contain many japanese characters. Then i want to plop
this text file into email body of OE.
I use this function to read the text file :

Function ReadTxtFile(strFileName As String) As Variant
Dim varText As Variant
Open strFileName For Binary As #1
varText = Input(LOF(1), #1) 'read whole file
Close #1
ReadTxtFile = varText 'set return variable
End Function

But this function can not read japanese character...anyway this only read
the english character...
Is there someone could give some advise or solution with my problem ??? or
repair this function ???

Your help is really appreciated... Please help me !!!

Thx..
david


Michael (michka) Kaplan

unread,
Sep 13, 2001, 1:13:13 AM9/13/01
to
well, you have not explained what you expect to happen with it? The methods
you would use to send mail from Access will not support multilingual
text....

--
MichKa

Michael Kaplan
(principal developer of the MSLU)
Trigeminal Software, Inc. -- http://www.trigeminal.com/
the book -- http://www.i18nWithVB.com/

"Postmaster" <in...@bali-tours.com> wrote in message
news:#Wu2tvAPBHA.1644@tkmsftngp05...

Postmaster

unread,
Sep 13, 2001, 2:47:10 AM9/13/01
to
Thank's michka... for your reply...

I will explain in details.... please give me your advise ..

I already have a report for "japanese reservation request" in access, then i
use macro to creaate a text file from this report.
I use "OutputTo" action for creating a text file. The text file will placed
in a directory in my harddrive. This text file contain
english characters also many japanese characters that i want to Plop into
email body directly ( not as an attachment ).

My OS is WIN2K, so when i open it using notepad.. it seems no problem..
because i can see these japanese characters correctly!

Then i used my ReadTxtFile function to read this text file to fill-up this
e-mail body. I use this msoe.dll MAPI setting to send e-mail
from OE. Please see my code below :

Function ReadTxtFile(strFileName As String) As Variant
Dim varText As Variant

Open strFileName For Binary As #1
varText = Input(LOF(1), #1) 'read whole file
Close #1
ReadTxtFile = varText 'set return variable
End Function

Sub TestSendMailwithOE()
Dim aRecips(0 To 0) As String

aRecips(0) = "smtp:davet...@hotmail.com"
SendMailWithOE "Test Send Email from Access",
ReadTxtFile("d:\MyData\test.txt"), aRecips
End Sub

This process run well, but the japanese characters can not read with
ReadTxtFile function.
Please advise me to solve my problem....

Thank you ... (^-^)

David - davet...@hotmail.com


"Michael (michka) Kaplan" <forme...@spamfree.trigeminal.nospam.com> wrote
in message news:eagWLLBPBHA.1496@tkmsftngp03...

Michael (michka) Kaplan

unread,
Sep 13, 2001, 2:59:50 AM9/13/01
to
Well, I do not know what the SendMailWithOE function is, but there is no
supported OE function that will sebnd the mail you are trying to send.
Obviously whatever the problem is, it is there (though shoving the binary
info into a variant may also be a problem).

--
MichKa

Michael Kaplan
(principal developer of the MSLU)
Trigeminal Software, Inc. -- http://www.trigeminal.com/
the book -- http://www.i18nWithVB.com/

"Postmaster" <in...@bali-tours.com> wrote in message

news:#hooBCCPBHA.580@tkmsftngp05...

Postmaster

unread,
Sep 13, 2001, 3:20:18 AM9/13/01
to
Thank's for your reply... (^0^)

I already do shove the binary info into a variant... please see this
function

> > Function ReadTxtFile(strFileName As String) As Variant
> > Dim varText As Variant
> >
> > Open strFileName For Binary As #1
> > varText = Input(LOF(1), #1) 'read whole file
> > Close #1
> > ReadTxtFile = varText 'set return variable
> > End Function

I can send the message from OE, i think my question is How to read text file
that contains japanese characters ?
Could you share me some access code or advise to read this file ?? Please
help...!

Thanks
David - davet...@hotmail.com


"Michael (michka) Kaplan" <forme...@spamfree.trigeminal.nospam.com> wrote

in message news:#iOawGCPBHA.1540@tkmsftngp03...

Michael (michka) Kaplan

unread,
Sep 13, 2001, 8:28:01 AM9/13/01
to
You can read it as a byte array instead of a variant and assign it directly
to a string. Seems a lot more sensible than what is happening now?

--
MichKa

Michael Kaplan
(principal developer of the MSLU)
Trigeminal Software, Inc. -- http://www.trigeminal.com/
the book -- http://www.i18nWithVB.com/

"Postmaster" <in...@bali-tours.com> wrote in message

news:#g0#hUCPBHA.404@tkmsftngp03...

Postmaster

unread,
Sep 14, 2001, 10:51:39 PM9/14/01
to
Thank's Mike !!!
Your clue is bring me new idea !!! But anyway... :P how to read as a byte
array ???
Please teach me !! Could you give me some vb code example ? (^0^)

Thank's

David
PS: I am a newbie...

"Michael (michka) Kaplan" <forme...@spamfree.trigeminal.nospam.com> wrote

in message news:uBgWI#EPBHA.1548@tkmsftngp03...

Michael (michka) Kaplan

unread,
Sep 15, 2001, 10:38:46 AM9/15/01
to
A byte array that is a Unicode string can be assigned directly to a string
variable. No fancy conversions needed.....

--
MichKa

Michael Kaplan
(principal developer of the MSLU)
Trigeminal Software, Inc. -- http://www.trigeminal.com/
the book -- http://www.i18nWithVB.com/

"Postmaster" <in...@bali-tours.com> wrote in message

news:eE6rbSZPBHA.1404@tkmsftngp03...

0 new messages