如果每次只对返回一行Text处理,则简单一些,不需要循环;
如果一次全部返回,可以参照以下程序.
Sub strRetTxt_selected()
Dim i, ix, iselcounts As Long '循环变量
Dim nColNums As Long 'Listview1的列数
Dim strRet() As String '二维数组:列,被选行
iselcounts = 0
With ListView1
nColNums = .ColumnHeaders.Count
For i = 1 To .ListItems.Count
If .ListItems(i).Selected Then
ReDim Preserve strRet(1 To nColNums, iselcounts) As String
strRet(1, iselcounts) = .ListItems(i).Text
For ix = 2 To nColNums
strRet(ix, iselcounts) = .ListItems(i).SubItems(ix - 1)
Next
iselcounts = iselcounts + 1
End If
Next
End With
End Sub