Please Help (Make Response)

HiPlease could someone help me, I have the following code that does the following…I cannot get it to work and am going mad!

Basically, there is a Meeting document and if the meeting is past today it needs to automatically create a feedback report, in the background and mail it to the presenter…this code seems to work but i cannot see the document in the view…any help would really be appreciated, I am stuck.

Here is the code:

Sub Initialize

Dim session As New NotesSession

Dim db As NotesDatabase

Dim view As NotesView

Dim ItemA As NotesItem

Dim ItemB As NotesItem

Dim ItemC As NotesItem

Dim ItemD As NotesItem

Dim ItemE As NotesItem

Dim ItemF As NotesItem	

Dim doc As NotesDocument

Dim doc2 As NotesDocument

Dim workspace As New NotesUIWorkspace



Set db = session.CurrentDatabase

Set view = db.GetView( "(CheckMeetingDate)" )



Set doc = view.GetFirstDocument

'Set doc = view.GetNextDocument(doc)

'While Not ( doc Is Nothing )

If doc.IENEventDate(0) < Today Then

	

	Call doc2.MakeResponse( doc ) 

	doc2.Form = "CFRF"		

		'Set doc2 = db.CreateDocument

		'Set itemB = doc2.AppendItemValue ("Form",  "CFRF" )	

	Set itemA = doc2.AppendItemValue ("IENCompany", Doc.IENCompany )

	Set itemC = doc2.AppendItemValue ("CFRDateOfMeet", Doc.IENEventDate )

	Set itemD = doc2.AppendItemValue ("IENCompanyDocID", Doc.IENCompanyDocID )

	Set itemE = doc2.AppendItemValue ("IENEventDescription", Doc.IENEventDescription )

	Set itemE = doc2.AppendItemValue ("$Ref", Doc.IENEventDocumentUniqueID )

	

	

	Call doc2.save(True,True)			

End If

'	Set doc = view.GetNextDocument( doc )

'Wend

'Call workspace.EditDocument(True, doc)



Set mailDoc = db.CreateDocument

mailDoc.Form="Memo"

mailDoc.sendTo="Colleen Brownhill"



Set rtItem = New NotesRichTextItem(mailDoc,"Body")

Call rtItem.appendDocLink(doc2,"Click here")

Call mailDoc.send(False)

'End If

End Sub

Thanks…C

Subject: Please Help (Make Response)

Does the CFRF form have a Readers field?

Subject: RE: Please Help (Make Response)

HiThanks for the response, no readers field…

C

Subject: @IsResponseDoc – Please Help (Make Response)

Basically, your view needs to include the new doc type in the selection formula – either by specifying the new form (Form = “CFRF”) or by using @IsResponseDoc/@AllChildren/@AllDescendants.