property Groups.Count as Long
Counts the news groups collection.

TypeDescription
Long A long expression that indicates the number of available news groups from the server.
The Count property counts the number of the news groups available on the news server.

The following sample prints the number of the news groups:

Dim n As New EXNNTPLibCtl.NNTP

Private Sub Form_Load()
    n.Connect "news.devx.com"
    Debug.Print n.Groups.Count
    n.Disconnect
End Sub

The following sample displays all news groups available on the news server:

Dim n As New EXNNTPLibCtl.NNTP

Private Sub Form_Load()
    Dim g As EXNNTPLibCtl.Group
    n.Connect "news.devx.com"
    For Each g In n.Groups
        Debug.Print g.Name
    Next
    n.Disconnect
End Sub

The following sample displays the news groups available on the news server by using the Item property of the Groups collection:

Dim n As New EXNNTPLibCtl.NNTP

Private Sub Form_Load()
    Dim g As EXNNTPLibCtl.Group
    n.Connect "news.devx.com"
    Dim i As Long
    For i = 0 To n.Groups.Count - 1
        Debug.Print n.Groups(i).Name
    Next
    n.Disconnect
End Sub