#!load hmessage.hsm Var( $SGrpNam, $GrpHdl, $ArtMin, $ArtMax, $ArtNo, $ArtFrom, $ArtTxt, $TempMsg, $FindStr, $TotArt, $Output ) # SGrpNam name of newsgroup to be checked # GrpHdl handle for selected group # ArtMin first atricle locally available in group # ArtMax last article locally available in group # ArtNo currently processed article number # FindStr String to search for # TempMsg ArtTxt converted to list, used for ArtDatH # Later used to store final message to be posted # ArtTxt text of current article, used for TempMsg # TotArt total number of articles posted # $Output List containing all found messages, saved to txt and loaded by notepad for display $SGrpNam = "nl.test" # if no (valid) parameter is given, we'll use nl.test as the source $SGrpNam = InputBox( "Enter group to search in:", "Group", "" ) # ask user for newsgroup $FindStr = InputBox( "Enter string to search for:", "String", "" ) # ask user for string $GrpHdl = HamGroupOpen( $SGrpNam ) If( $GrpHdl >= 0 ) # no error? $ArtMin = HamArtNoMin( $GrpHdl ) # get first article locally available $ArtMax = HamArtNoMax( $GrpHdl ) # get last article locally available $TempMsg = ArtAlloc # list containing currently processed article $Output = ListAlloc # list containing all found matches $TotArt = 0 $ArtNo = $ArtMin # start at first article available While( $ArtNo <= $ArtMax ) # process all available articles $ArtTxt = HamArtText( $GrpHdl, $ArtNo ) #store article in string If( Pos( $FindStr, $ArtTxt ) > 0 ) Inc( $TotArt ) ArtSetHeaders($TempMsg, $ArtTxt) # convert article headers to list (body is ignored) ListAdd( $Output, Str( $TotArt, 4, " " ) + ": " + ArtGetHeader( $TempMsg, "From:" ) + " || " + ArtGetHeader( $TempMsg, "Date:" ) + " || " + ArtGetHeader( $TempMsg, "Message-ID:" ) ) EndIf Inc( $ArtNo ) # go to next article EndWhile If( $TotArt > 0 ) ListSave( $Output, "TempList.txt" ) # save list to temporary file Execute( "Notepad.exe TempList.txt" ) # open file with Notepad FileDelete( "TempList.txt" ) # delete file Else MsgBox( "No matching article found.") EndIf ArtFree( $TempMsg ) ListFree( $Output ) EndIf HamGroupClose( $GrpHdl ) Quit