ListArticles Method

Return a list of articles in the current newsgroup.

Syntax

object.ListArticles( [FirstArticle], [LastArticle] )

Remarks

The ListArticles method requests that the server return a list of news articles in the specified range for the current newsgroup. The OnNewsArticle event will be fired for each article returned by the server. When the last news article has been listed, the OnLastArticle event will be fired.

While the articles in the newsgroup are being listed, the client cannot retrieve the contents of a specific article. For example, the GetArticle method cannot be called while inside the OnNewsArticle event. The client should store those articles which it wants to retrieve in an array, and then once all of the articles have been listed, it can begin calling GetArticle for each article number to retrieve the article text.

A program should use either the ListArticles method or the GetFirstArticle and GetNextArticle methods, but never in combination with one another. The ListArticles method is event driven and more suited for asynchronous connections. The GetFirstArticle and GetNextArticle methods are more appropriate for scripting languages such as VBScript.

FirstArticle
An optional integer argument which specifies the first article to list. If this argument is omitted, the list will start with the first available article in the newsgroup.
LastArticle
An optional integer argument which specifies the last article to list. If this argument is omitted, the list will end with the last available article in the newsgroup.

Return Value

A value of zero is returned if the operation was successful, otherwise a non-zero error code is returned which indicates the cause of the failure.

See Also

FirstArticle Property, LastArticle Property, GetFirstArticle Method, GetNextArticle Method, SelectGroup Method, OnLastArticle Event, OnNewsArticle Event


Copyright © 2008 Catalyst Development Corporation. All rights reserved.