ファイルの読込、保存
読込
サンプルソース
Private Sub Command2_Click() Dim strBuff As String Dim strPath As String strPath = App.Path & "\List.txt" Open strPath For Input As #1 Do Until EOF(1) Input #1, strBuff List1.AddItem strBuff Loop Close #1 End Sub
保存
サンプルソース
Private Sub Command1_Click() Dim i As Integer Dim strBuff As String Dim strPath As String strPath = App.Path & "\List.txt" Open strPath For Output As #1 strBuff = Format(Date, "yy/mm/dd") & " " & Format(Time, "hh:mm:ss") Write #1, strBuff For i = 0 To 10 strBuff = "Write_data" & i + 1 Write #1, strBuff Next i For i = 0 To 20 strBuff = "Print_data" & i + 1 Print #1, strBuff Next i Close #1 End Sub