Call dc.addDocument ( tmp) getting object variable not set. Any ideas what is missing here?
code:::
Sub Click(Source As Button)
Dim ws As New notesuiworkspace
Dim uidoc As notesuidocument
Set uidoc = ws.currentdocument
Set doc = uidoc.document
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
Dim vw As NotesView
Set vw = db.GetView( "Documents by Form Name" )
Dim dc As NotesDocumentCollection
If doc.BasicSearch(0) = "" Then
Messagebox ("You must enter search criteria in 'Free Form Text' area")
End If
Call uidoc.Refresh()
searchFormula$ = doc.string(0)
Dim tmp As New NotesDocument(db)
Set dc = tmp.Responses ' Trick to get empty collection
Call vw.FTSearch( SearchFormula$, 0 )
Set tmp = vw.GetFirstDocument
Do Until tmp Is Nothing
Call dc.AddDocument( tmp)
Set tmp = vw.GetNextDocument( tmp)
Loop
Set news = New NotesNewsletter(dc)
news.DoScore = False
news.DoSubject = True
news.SubjectItemName = "Subject"
Set doc = news.FormatMsgWithDoclinks(db)
doc.subject = searchFormula$
doc.form = "Search Results"
doc.SaveOptions = "0"
Set uidoc = ws.EditDocument(False, doc)
End Sub

2nd post - Object variable not set (Al John 10.Jan.06)
. . 