Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

creating non .txt files in vb6

  • 14-09-2005 7: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