Results 1 to 4 of 4

Thread: reading files

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2000
    Posts
    6
    okay, i no the code for reading or writing to files on a:\, but im not sure how u do it for any files of c:\. i mean... how do u chose what files to write/read to @ run time?? it would be really great if some1 could help

    thanks

    burn

  2. #2
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Lightbulb

    Just set you filepath and it will does for you.

    Code:
    Open "C:\Test.log" For Input As #1
        'Do what ever you like here.
    Close #1

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2000
    Posts
    6
    ja i no, but is it possible to chose the file path at run time???

  4. #4
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Lightbulb InputBox

    Sure you can... just do it like below.

    Code:
    Private Sub Form_Load()
    Dim MyFile As String
    MyFile = InputBox ("Please Enter The FileName.","Select File","") 
    If MyFile <> "" then OpenFile(MyFile)
    End Sub
    
    Private Sub OpenFile (lpFileName As String)
    Open lpFileName For Input As #1
        'Do what ever you like here.
    Close #1
    End sub

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