masj78
Active member
Please help someone!
I am trying to get a display of the emails in my Inbox in my application using a ListView.
I can get the first item and subitem in my Loop cycling through the Inbox. However I cannot get any more subItems to print in the remaining collumns. If I do I get this error message:
A first chance exception of type System.Reflection.AmbiguousMatchException occurred in microsoft.visualbasic.dll
Additional information: No accessible overloaded ListViewSubItemCollection.Add can be called without a narrowing conversion.
My code is as follows:
VB.NET:
Dim objMessage As MAPI.Message
Dim lstStuff As New ListViewItem
Dim count As Integer
With ListView1.Items
For Each objMessage In gobjSession.Inbox.Messages
count = count + 1
lstStuff = .Add(objMessage.Size)
With lstStuff
.SubItems.Add(objMessage.Subject)
.SubItems.Add(objMessage.TimeReceived) error if add this extra line
End With
Next
End With
End Sub
Cheers!
I am trying to get a display of the emails in my Inbox in my application using a ListView.
I can get the first item and subitem in my Loop cycling through the Inbox. However I cannot get any more subItems to print in the remaining collumns. If I do I get this error message:
A first chance exception of type System.Reflection.AmbiguousMatchException occurred in microsoft.visualbasic.dll
Additional information: No accessible overloaded ListViewSubItemCollection.Add can be called without a narrowing conversion.
My code is as follows:
VB.NET:
Dim objMessage As MAPI.Message
Dim lstStuff As New ListViewItem
Dim count As Integer
With ListView1.Items
For Each objMessage In gobjSession.Inbox.Messages
count = count + 1
lstStuff = .Add(objMessage.Size)
With lstStuff
.SubItems.Add(objMessage.Subject)
.SubItems.Add(objMessage.TimeReceived) error if add this extra line
End With
Next
End With
End Sub
Cheers!
Last edited by a moderator: