?
Solved

How ANSI text file  from vb6

Posted on 2009-07-02
7
Medium Priority
?
553 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
0
Comment
Question by:luani
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 93

Expert Comment

by:Patrick Matthews
ID: 24763008
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...
0
 
LVL 7

Author Comment

by:luani
ID: 24763065
 Set fs = CreateObject("Scripting.FileSystemObject")

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

    a.WriteLine (str)
0
 
LVL 93

Expert Comment

by:Patrick Matthews
ID: 24763101
luani,

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

Regards,

Patrick
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 7

Author Comment

by:luani
ID: 24763238
I use normal characters, char(9) to separate values and char(13) for CRLF.
0
 
LVL 7

Author Comment

by:luani
ID: 24763254
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.
0
 
LVL 93

Accepted Solution

by:
Patrick Matthews earned 500 total points
ID: 24763341
luani said:
>>char(13) for CRLF.

ANSI 13 is just carriage return; typically you want ANSI 13 *and* ANSI 10 as your line delimiters.

Have you tried using vbCrLf instead of Chr(13)?
0
 
LVL 7

Author Comment

by:luani
ID: 24783425
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!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question