Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

creating non .txt files in vb6

  • 14-09-2005 08:16PM
    #1
    Closed Accounts Posts: 5,284 ✭✭✭


    Open szFileName For Output As #2
    

    When this is passed a string such as "test.abc", for example, it creates a file "test.txt" instead of using the extension I want. Why is this happening please?


Comments

  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    for vb6 you have to specify the filetype before hand but I forget the command. :/


  • Closed Accounts Posts: 5,284 ✭✭✭pwd


    It was saving correctly after all, but this computer was displaying the file type as text files (wrongly).


  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    Try using the streams instead? eg.
    Set FileSys = CreateObject("Scripting.FileSystemObject")
    Set outStream = FileSys.CreateTextFile(outFile, OverwriteIfExist, OpenAsASCII)
    Do
    	outStream.WriteLine textLine
    Loop Until inStream.AtEndOfStream ' change to whatever.
    outStream.Close
    


  • Closed Accounts Posts: 5,284 ✭✭✭pwd


    sorry I meant that it was working already - the PC I was using had weird file associations that made it look like it wasn't at first.


Advertisement