Dim file(2) As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Not TextBox7.Text = Nothing Then
Dim attach As New Attachment(TextBox7.Text)
message.Attachments.Add(attach)
End If
If Not TextBox8.Text = Nothing Then
Dim attach As New Attachment(TextBox8.Text)
message.Attachments.Add(attach)
End If
If Not TextBox9.Text = Nothing Then
Dim attach As New Attachment(TextBox9.Text)
message.Attachments.Add(attach)
End If
Private Sub Button2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
file = Nothing
OpenFileDialog1.ShowDialog()
file = OpenFileDialog1.FileNames
Try
TextBox7.Text = file(0)
Catch ex As IndexOutOfRangeException
End Try
Try
TextBox8.Text = file(1)
Catch ex As IndexOutOfRangeException
End Try
Try
TextBox9.Text = file(2)
Catch ex As IndexOutOfRangeException
End Try
End Sub