If I understand you correctly, you want to resize a ListView based on the text in it. The easiest way to do it is to use SendMessage API. Here is a little example:
Code:
Option Explicit
Private Const LVM_FIRST As Long = 4096
Private Const LVM_SETCOLUMNWIDTH As Long = (LVM_FIRST + 30)
Private Const LVSCW_AUTOSIZE_USEHEADER As Long = -2
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Sub Form_Load()
Dim itmListItem As ListItem
Dim i As Integer
Dim j As Integer
With ListView1
.ColumnHeaders.Add , , "Column1"
.ColumnHeaders.Add , , "Column2"
.ColumnHeaders.Add , , "Column3"
.ColumnHeaders.Add , , "Column4"
For i = 1 To 10
Set itmListItem = .ListItems.Add(, "Item" & i, "Item" & i)
For j = 1 To .ColumnHeaders.Count - 1
itmListItem.SubItems(j) = "SubItem with long text " & i & j
Next
Next
End With
End Sub
Private Sub Command1_Click()
Dim intCol As Integer
With ListView1
For intCol = 0 To .ColumnHeaders.Count - 1
Call SendMessage(.hwnd, LVM_SETCOLUMNWIDTH, intCol, ByVal LVSCW_AUTOSIZE_USEHEADER)
Next
End With
End Sub
By clicking the button, ListView will be resized according the text in it.