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?
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?