Return information about the first available newsgroup.
Syntax
object.GetFirstGroup( ByVal
GroupName As Variant, [ByVal
FirstArticle As Variant], [ByVal
LastArticle As Variant], [ByVal Access
As Variant] )
Remarks
The GetFirstGroup method returns information about the
first newsgroup on the server. This method is used in conjunction
with the GetNextGroup method to enumerate all of the
available newsgroups. Typically this is used to provide the user
with a list of newsgroups to select. If the LastUpdate
property is set, then only newsgroups that have been created since
that date will be returned.
While the the newsgroups are being listed, the client cannot
select a newsgroup or retrieve the contents of a specific article.
The client should store those newsgroups which it wants to retrieve
articles from, and then once all of the newsgroups have been
listed, it can then select each newsgroup and retrieve the
available articles from that group.
A program should use either the ListGroups method or the
GetFirstGroup and GetNextGroup methods, but never in
combination with one another. The ListGroup method is event
driven and more suited for asynchronous connections. The
GetFirstGroup and GetNextGroup methods are more
appropriate for scripting languages such as VBScript.
- GroupName
- An string value which specifies the name of the newsgroup.
- FirstArticle
- An integer value which specifies the number for the first
available article in the newsgroup. This value corresponds to the
FirstArticle property of a selected newsgroup. This argument
is optional and may be omitted if the program does not require this
information.
- LastArticle
- An integer value which specifies the number for the last
available article in the newsgroup. This value corresponds to the
LastArticle property of a selected newsgroup. This argument
is optional and may be omitted if the program does not require this
information.
- Access
- An integer value which specifies the access rights for the
newsgroup. This argument is optional and may be omitted if the
program does not require this information. It may be one of the
following values:
| Value |
Constant |
Description |
| 0 |
nntpGroupReadOnly |
The group is read-only and cannot
be modified. Attempts to post articles to the newsgroup will result
in an error. |
| 1 |
nntpGroupReadWrite |
Articles can be posted to the
newsgroup. Even though a newsgroup is read-write, it may require
that the client authenticate before being given permission to post
articles to the server. |
| 2 |
nntpGroupModerated |
The newsgroup is moderated and
articles can only be posted by the group moderator. To request that
an article be posted to the newsgroup, you must email the message
to the moderator. |
Return Value
A value of true is returned if the operation was successful,
otherwise a return value of false indicates that there are no
newsgroups available on the server. Note that if no newsgroups are
returned by the server, it may indicate that it requires the client
to authenticate itself prior to requesting a list of groups or
articles.
Example
Dim strGroupName As String
Dim bResult As Boolean;
' List each newsgroup available on the server, adding the group name
' to a ListBox control
bResult = NntpClient1.GetFirstGroup(strGroupName)
Do While bResult
List1.AddItem strGroupName
bResult = NntpClient1.GetNextGroup(strGroupName)
End Do
See Also
GroupName Property,
GroupTitle Property,
LastUpdate Property,
GetNextGroup Method, ListGroups Method
|