1. This script searches the current database for the phrase "printing press." Every document containing the phrase is placed into the collection.
Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Set db = session.CurrentDatabase
Set collection = db.FTSearch( """printing press""", 0 _
FT_SCORES, FT_STEMS)
2. This script creates a newsletter of the top ten documents in the INVNTION.NSF database that contain the word "vaccine," and mails it to Joann Smera. If the database isn't full-text indexed, the script does nothing.
Dim db As New NotesDatabase( "Berlin", "invntion.nsf" )
Dim collection As NotesDocumentCollection
Dim newsletter As NotesNewsletter
Dim doc As NotesDocument
If db.IsFTIndexed Then
Set collection = db.FTSearch( "vaccine", 10 )
Set newsletter = New NotesNewsletter( collection )
Set doc = newsletter.FormatMsgWithDoclinks( db )
doc.Form = "Memo"
doc.Subject = "Here's the newsletter you requested."
Call doc.Send( False, """Joann Smera""" )
End If