Results 1 to 20 of 22

Thread: Browse a Folder and Populate Listbox with Folder Items

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #17
    @bigJD
    Create a textbox "Textbox1"
    Replace Private Sub ListBox1_Click() with this code ;
    Dim txt As String
        With Me.Listbox1
        If .ListIndex > -1 Then
            If FileLen(.Value) Then
                Me.Textbox1.Value = _
                CreateObject("Scripting.FileSystemObject") _
                .OpenTextFile(.Value).ReadAll
            Else
                Me.Textbox1.Value = ""
            End If
        End If
        End With
    On your SAVE button which is CommandButton3 put this code

    With Me
        If .Listbox1.ListIndex > -1 Then
            Open Listbox1.Value For Output As #1
            Print #1, .Textbox1.Value
            Close #1
        End If
        End With
    That will work IMO.
    Last edited by Aussiebear; 03-14-2025 at 11:23 AM.

Posting Permissions

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