This view action script uses the UnprocessedDocuments property
in NotesDatabase to get a collection of documents currently selected
in the view. If there are five or fewer selected documents, the script
creates a rendering of each document in the collection and saves it
in the current user's mail database.Sub Click(Source As Button)
Dim session As New NotesSession
Dim db As NotesDatabase
Dim mailDb As NotesDatabase
Dim collection As NotesDocumentCollection
Dim newsletter As NotesNewsletter
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set mailDb = New NotesDatabase( "", "" )
Call mailDb.OpenMail
Set collection = db.UnprocessedDocuments
Set newsletter = New NotesNewsletter( collection )
If ( collection.Count > 5 ) Then
Messagebox( "Please select five documents or fewer" )
Else
For j = 1 To collection.Count
Set doc = newsletter.FormatDocument( mailDb, j )
Call doc.Save( True, True )
Next
End If
End Sub