v_gyku
09-30-2005, 12:11 AM
I have a listview on a form, in that listview i am displaying to, subject and sentdate from outlook inbox.
When i select any of the item from listbox i get the subject for the selected item by this code :
objform.ListView1.SelectedItem.SubItems(1)
But i also want body of the selected message. Note that i am not taking body in the listview. If i take body in listview it will be quite easy to get it(same as above code.) But, I dont want to show body in listview. Or is there any way that i can hide body column from listview.............. Or without adding it to listview can i get ody of the selected message?
This code is for inbox
Dim oinFolder As Object
Set oinFolder = oNameSpace.GetDefaultFolder(outlook.OlDefaultFolders.olFolderInbox)
THis is the code for adding to listview
For Each Inboxmail In oinFolder.Items
Dim j As Integer
j = 1
With ListView1.ListItems
.Add j, , Inboxmail.To
End With
With ListView1
.ListItems(j).SubItems(1) = Inboxmail.subject
End With
With ListView1
.ListItems(j).SubItems(2) = Inboxmail.SentOn
End With
'With ListView1
' .ListItems(j).SubItems(3) = Inboxmail.body
' End With
j = j + 1
Next
When i select any of the item from listbox i get the subject for the selected item by this code :
objform.ListView1.SelectedItem.SubItems(1)
But i also want body of the selected message. Note that i am not taking body in the listview. If i take body in listview it will be quite easy to get it(same as above code.) But, I dont want to show body in listview. Or is there any way that i can hide body column from listview.............. Or without adding it to listview can i get ody of the selected message?
This code is for inbox
Dim oinFolder As Object
Set oinFolder = oNameSpace.GetDefaultFolder(outlook.OlDefaultFolders.olFolderInbox)
THis is the code for adding to listview
For Each Inboxmail In oinFolder.Items
Dim j As Integer
j = 1
With ListView1.ListItems
.Add j, , Inboxmail.To
End With
With ListView1
.ListItems(j).SubItems(1) = Inboxmail.subject
End With
With ListView1
.ListItems(j).SubItems(2) = Inboxmail.SentOn
End With
'With ListView1
' .ListItems(j).SubItems(3) = Inboxmail.body
' End With
j = j + 1
Next