Here you go:
Code:Option Explicit Private Sub Command1_Click() 'to get a certain item... Debug.Print getItem(ListView1, 3) 'to get the complete list... Debug.Print "***" Dim i As Integer For i = 1 To ListView1.ListItems.Count Debug.Print getItem(ListView1, i) Next i End Sub Private Function getItem(lvw As ListView, n As Integer) As String If n > 0 And n <= lvw.ListItems.Count Then Dim lvwItem As ListItem Set lvwItem = lvw.ListItems.Item(n) getItem = lvwItem.Text & " will play in " & lvwItem.SubItems(1) & " + " If n > 1 Then Set lvwItem = lvw.ListItems.Item(n - 1) getItem = getItem & lvwItem.SubItems(1) Else getItem = getItem & "00:00:00" End If Else getItem = "Index out of bounds" End If End Function




Reply With Quote