PDA

View Full Version : Solved: listview logic



v_gyku
10-02-2005, 10:48 PM
I am taking mails from inbox(to, subject, sentdate) in a listview.
I am giving u the code snippet i am using.



If (oinFolder Is Nothing) Or (oinFolder.Items.Count < 1) Then
initems = False
Else

j = 1
For Each Inboxmail In oinFolder.Items

If Inboxmail.Class = olMail Then

With ListView1.ListItems
.Add j, , Inboxmail.To
End With

With ListView1
.ListItems(j).SubItems(1) = Inboxmail.subject
'.ListItems(j).ListSubItems(1).Tag = Inboxmail.body
End With

With ListView1
.ListItems(j).SubItems(2) = Inboxmail.SentOn
End With
'End If

ElseIf Inboxmail.Class = olReport Then
j = j - 1
End If
j = j + 1
Next



I am getting 1st and last item in a listview properly.
But i am not getting column 2 and 3 values for rest., i.e. Its displays nothing.

What should i change in the above code?

Bob Phillips
10-09-2005, 10:41 AM
Can you show all your code to save having to work it out?

v_gyku
10-10-2005, 02:42 AM
Sorry i forgot to mark thread solved.

I have changed certain properties of the list view and it worked fine..

Yhank You.....