Sub Click(Source As Button)
Dim directory As NotesDbDirectory
Dim db As NotesDatabase
server$ = "Ruslan"
Set directory = New NotesDbDirectory( server$ )
dbType% = DATABASE'TEMPLATE_CANDIDATE
Set db = directory.GetFirstDatabase( dbType% )
counter% = 0
While Not ( db Is Nothing )
counter% = counter% + 1
Set db = directory.GetNextDatabase
If Cstr(Lcase(Left(db.Filepath, 4))) = "mail" Then
Messagebox db.FilePath,,server$
Dim ProcessDb As New NotesDatabase("", "")
Call ProcessDb.Open(db.Server, db.Filepath)
If ProcesDb.IsOpen Then
Dim collection As NotesDocumentCollection
Set collection = db.Search({Subject = "Test"} , Nothing,0)
If collection.Count > 0 Then
Print "Tete" ' Если все ништяк...
End If
End If
End If
Wend
End Sub