We help IT Professionals succeed at work.

How ANSI text file  from vb6

660 Views
Last Modified: 2013-11-18
Hi,
I  want to create an ANSI text file from vb6 code. I used to create dhe text file from the FileSystemObject but the file is not in the ANSI format.

Any idea?

Thanks,
Luan
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2010

Commented:
luani said:
>>I used to create dhe text file from the FileSystemObject but the file is not in the ANSI format.

Please post your code.  I use the FSO frequently, and I always get ANSI text back from it...
Luan JubicaProject Manager

Author

Commented:
 Set fs = CreateObject("Scripting.FileSystemObject")

    Set a = fs.CreateTextFile(FileName + " " + ConvertDt(Now) + ".txt", True)

    a.WriteLine (str)
CERTIFIED EXPERT
Top Expert 2010

Commented:
luani,

OK, now how do you determine the value of your variable str?  Are sticking Unicode text into that variable?

Regards,

Patrick
Luan JubicaProject Manager

Author

Commented:
I use normal characters, char(9) to separate values and char(13) for CRLF.
Luan JubicaProject Manager

Author

Commented:
I use these files as input in another program which does not recognize them as ANSI. To make them recognizable I use ultraedit to save them as ANSI format. Then everything works fine.
CERTIFIED EXPERT
Top Expert 2010
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Luan JubicaProject Manager

Author

Commented:
Thank you for your advice! I was betting I had tried this, but it resulted that I didn't.
After the replacement it worked fine!
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.