You need to use the Text property.
Note that I used StreamWriter method
WriteLine
instead of
Write
.
Private Sub UpdateJournal()
Dim JournalFileName As String = "EtxJournal.dat"
Dim JournalLine As String
Dim x As Integer
Dim aryText(4) As String
Dim objWriter As New System.IO.StreamWriter(JournalFileName, False)
For x = 0 To lsv_Journal.Items.Count - 1
JournalLine = lsv_Journal.Items(x).SubItems(0).Text & "|" & _
lsv_Journal.Items(x).SubItems(1).Text & "|" & _
lsv_Journal.Items(x).SubItems(2).Text & "|" & _
lsv_Journal.Items(x).SubItems(3).Text & "|" & _
lsv_Journal.Items(x).SubItems(4).Text & "|" & _
lsv_Journal.Items(x).SubItems(5).Text & "|" & _
lsv_Journal.Items(x).SubItems(6).Text & "|" & _
lsv_Journal.Items(x).SubItems(7).Text & "|" & _
lsv_Journal.Items(x).SubItems(8).Text & "|" & _
lsv_Journal.Items(x).SubItems(9).Text
objWriter.WriteLine(JournalLine)
Next x
objWriter.Close()
End Sub
Here is an alternative using StringBuilder:
Imports System.Text
...
Private Sub UpdateJournal()
Dim JournalFileName As String = "EtxJournal.dat"
Dim JournalLine As New StringBuilder(4096)
Dim x As Integer
Dim y As Integer
Dim aryText(4) As String
Dim objWriter As New System.IO.StreamWriter(JournalFileName, False)
For x = 0 To lsv_journal.Items.Count - 1
For y = 0 To 9
JournalLine.Append(lsv_journal.Items(x).SubItems(y).Text)
If y <> 9 Then JournalLine.Append("|")
Next
objWriter.WriteLine(JournalLine.ToString)
Next x
objWriter.Close()
End Sub