I am VERY new to Scripting. All I am trying to do is have a button that lets me select a multiple files and then list them in a window below the button (for selection later). I have figured out how to at least OPEN the windows but when I select multiple files I get an error "NullRefere nce Exception was unhandled"
Anyhow my starting code is below. Any assistance would be great. Thanks
Anyhow my starting code is below. Any assistance would be great. Thanks
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim openFileDialog1 As New OpenFileDialog
Dim fName As String
openFileDialog1.InitialDirectory = "c:\"
openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"
openFileDialog1.FilterIndex = 2
openFileDialog1.RestoreDirectory = True
openFileDialog1.Multiselect = True
If openFileDialog1.ShowDialog() = DialogResult.OK Then
For Each fName In openFileDialog1.FileNames
lstWrkFiles.Items.Add(fName)
Next
End If
Comment