title: Vb6: Selecting a file to later be used via a browse button
body: <p>Here's my code (note that this was given by a friend):</p>
  
  <pre><code>Private Sub Browse_Click()
     Dim textfile As String
     textfile = Space(255)
     GetFileNameFromBrowseW Me.hWnd, StrPtr(sSave), 255, StrPtr("c:\"), 
        StrPtr("txt"), StrPtr("Apps (*.txt)" + Chr$(0) + "*.txt" + Chr$(0) +
        "All files (*.*)" + Chr$(0) + "*.*" + Chr$(0)), StrPtr("Select File")
        Text1 = Left$(textfile, lstrlen(textfile))
  End Sub
  </code></pre>
  
  <p>Basically later on I edit the text file selected so later I call it just by using textfile in my function.  However I get a path not found so I feel like I'm doing something wrong. 
  Thanks in advance.</p>
  
  <p>Edit:  All I want to do is select a text file, then later be able to call it and use it.</p>