ItemCount Property  
 

Gets value which specifies the number of news items in the channel.

Syntax

object.ItemCount

Remarks

The ItemCount property returns an integer value which specifies the number of items in the current news feed channel. This property can be used in conjunction with the GetItem method to enumerate through the available news feed items.

Data Type

Integer (Int32)

Example

The following example accesses a remote feed and enumerates each news item, populating the contents of a ListBox control with its title.

Dim strFeed As String
Dim nIndex As Long
Dim nError As Long
    
strFeed = "http://sockettools.com/rss/news.xml"
ListBox1.Clear
    
nError = NewsFeed1.Open(strFeed)
If nError > 0 Then
    MsgBox NewsFeed1.LastErrorString, vbExclamation
    Exit Sub
End If
    
Label1.Caption = NewsFeed1.ItemCount & " news items, published on " & NewsFeed1.Published
    
For nIndex = 1 To NewsFeed1.ItemCount
    nError = NewsFeed1.GetItem(nIndex)
    If nError > 0 Then
        MsgBox NewsFeed1.LastErrorString, vbExclamation
        Exit For
    End If
    ListBox1.AddItem NewsFeed1.ItemTitle
Next

See Also

ItemGuid Property, ItemId Property, ItemText Property, GetItem Method