Dim sNewName As String CommonDialog1.DialogTitle = "Enter Name To Save File As" CommonDialog1.Filter = "Text File (*.txt) | *.txt" CommonDialog1.ShowSave sNewName = CommonDialog1.filename MsgBox sNewName If sNewName <> "" Then Open sNewName For Output As #1 Print #1, Close #1 sFileName = sNewName End If
CommonDialog1.DialogTitle = "Enter Name Of File To Open" CommonDialog1.Filter = "Txt Files (*.txt) | *.txt" CommonDialog1.ShowOpen sFileName = CommonDialog1.filename If sFileName = "" Then Exit Sub Open sFileName For Input As #1 For i = 1 To MAXLINES If EOF(1) Then Exit For Line Input #1, strline strline = Trim(strline) If Len(strline) <> 0 Then List1.AddItem strline Next i Close #1 lbl1count = List1.ListCount cityname = InputBox("What is the Name of the City?", "Name of City") lbl1city.Caption = cityname Exit Sub
Open ... AS #1 For i = 0 to ListBox1.ListCount -1 Print #1, ListBox1.List(i) Next i Close #1
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)