CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 1999
    Location
    California, USA
    Posts
    40

    Saving to a .txt file

    yeah whats the code for saving a txt file? you no where you go File|Save. thanks

    PanasonicSubz

  2. #2
    Guest

    Re: Saving to a .txt file

    Using this code, you open (if exists) or create (if it doesn't) Test.txt file in an Application folder, enter some values and save the file:


    private Sub Command1_Click()
    Dim intFileNumber as Integer
    Dim lngPosition as Long
    intFileNumber = FreeFile
    Open App.Path & "\Test.txt" for Output lock Read Write as #intFileNumber

    Write #intFileNumber, "It works", "Hello, World"
    Close #intFileNumber
    End Sub



    Vlad


  3. #3
    Join Date
    Dec 1999
    Location
    Austria
    Posts
    17

    Re: Saving to a .txt file

    Private Sub Write_to_File()
    Open "C:\TEST.TEXT" For Append As #1
    Print #1, "Test"
    Close #1
    End Sub



  4. #4
    Join Date
    Sep 1999
    Location
    Germany
    Posts
    66

    Re: Saving to a .txt file


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured