#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2006
    Location
    Greeley,Colorado
    Posts
    9
    Rep Power
    0

    How Do I Make A Text Box Send Text to a text file?


    I need to know what command i would use to send text entered in a text box to a text file using a command buttton.
    Your advice would again be very appreciated!
  2. #2
  3. Type Cast Exception
    Devshed Supreme Being (6500+ posts)

    Join Date
    Apr 2004
    Location
    OAKLAND CA | Adam's Point (Fairyland)
    Posts
    14,954
    Rep Power
    8617
    off the top of my head

    Code:
    Private Sub Command1_Click()
        Dim FileID As Integer
        Dim strFileName As String
        strFileName = InputBox("Enter the full path of the file to save to e.g. c:\helloworld.txt")
        If Len(strFileName) Then
            FileID = FreeFile
            Open strFileName For Output As #FileID
            Print #FileID, Text1.Text
            Close #FileID
        End If
    End Sub
    You can obviously improve it but it works in any VB
    medialint.com

    “Today you are You, that is truer than true. There is no one alive who is Youer than You.” - Dr. Seuss

IMN logo majestic logo threadwatch logo seochat tools logo