So my problem begins at Line 20 when I am trying to Open the file For Output. It just does not seem to be working, Please Help.
Private Sub btnSaveYL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSaveYL.Click
Dim Location As String
Dim NextItem As Long
Dim Answer As MsgBoxResult
If lstYourList.Items.Count <= 0 Then
MsgBox("Sorry, not enough entries. You need at least 1 item in 'Your List' to be able to save.", vbOKOnly & vbCritical, "Nothing In List!")
Else
Answer = MsgBox("Are you sure you want to Save 'Your List' to a location that you specify?" & vbCrLf & "You will need to Attach this in an E-Mail and send to me." & vbCrLf & "Are You Sure?", vbYesNo + vbQuestion, "Save?")
If Answer = vbYes Then
With saveYourList
.InitialDirectory = "C:\"
'.Filter = "Text Files (*.txt)|*.txt"
.ShowDialog()
End With
If Len(saveYourList.FileName) = 0 Then
MsgBox("You pressed the Cancel button.", vbOKOnly + vbExclamation, "Canceled!")
Else
Location = saveYourList.FileName
FileOpen Output As #1
For NextItem = 0 To lstYourList.Items.Count - 1
Print #1, lstYourList.Items(NextItem)
Next
Close #1
End If
ElseIf Answer = vbNo Then
MsgBox("You decided not to save your list.", vbOKOnly, "No Save.")
End If
End If
End Sub

New Topic/Question
Reply




MultiQuote





|