Hi, I have a problem with checking a Listview for new items. I think it should be quite easy, but I can't figure it out.
The data in my Listview gets updated from an online XML file (RSS feed). After the data has been added to the Listview, all items are added to a Collection as well.
When the data is updated again, I want to loop through the Listview items and check if an item also exists in the Collection (which consists of data from the previous update). If the Listview item cannot be found in the Collection it means it's new data and I want to make it bold.
I can't simply count Listview items, because most of the time the updated data is partially the same.
vb Code:
If cItems.Count <> 0 Then For i = 1 To lvwXML.ListItems.Count 'Loop through Listview tmp = lvwXML.ListItems(i).Text 'Put item in a variable For y = 1 To cItems.Count 'Loop through the Collection '// If Listview item is not in the Collection it's new data If tmp ????? Then lvwXML.ListItems(i).Bold = True End If Next y Next i End If Set cItems = Nothing Set cItems = New Collection For i = 1 To lvwXML.ListItems.Count cItems.Add lvwXML.ListItems(i).Text 'Store current Listview data in Collection again to use with the next update Next i




Reply With Quote