How can I change this code....?

HiHow can I change this code…I need to set docB to something…at the moment it replaces the second doc in view with the response doc…I would like it to add a doc to the view…have tried a few things but getting error.

Here is code:

Sub Initialize

Dim session As New NotesSession

Dim db As NotesDatabase

Dim view As NotesView

Dim docA As NotesDocument

Dim docB As NotesDocument

Set db = session.CurrentDatabase

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

Set docA = view.GetFirstDocument

Set docB = view.GetNextDocument( docA )

Call docB.MakeResponse( docA )

docB.Form = "CFRF"

Call docB.Save( True, True )

End Sub

Many thanks…C

Subject: How can I change this code…??

I think you need to explain exactly what you’re trying to acheive. From what I can work out you simply want to create a new response document to the first document in the view. This seems unlikely to me.

If that is the case though, just replace your current set docB line with:

set docB = db.createdocument

Dan

Subject: RE: How can I change this code…??

You would also need to use a MakeResponse method to associate the response to docA. But, the main question remains, what are you tryingto achieve?

Subject: RE: How can I change this code…??

HiI am trying to loop thru a view which stores meetings…once meeting is complete…it must create a report back via an agent…mail to user and store in the view…

C