Hi All, I have written an agent on web it is for selected documents. when i select more than one document but it is coping only one selected document but not other selected documents so here is code plz follow the code and help me what i m missing in the code.
Thx in Advance
Santosh
Sub Initialize
On Error Goto ErrHandle
Dim sess As New NotesSession
Dim db As NotesDatabase
Dim db2 As New NotesDatabase("", "TEst123.nsf")
Dim doc As NotesDocument
Dim coll As NotesDocumentCollection
Dim i As Integer
Set db=sess.CurrentDatabase
Set coll=db.AllDocuments
For i=1 To coll.Count
Set doc=coll.GetNthDocument(i)
Call doc.CopyToDatabase(db2)
Next
ErrHandle:
Print "<BR><H1>Your Document has been added.</H1><BR>"
Print "<BR><BR><BR><font size=1>Error code:" & Err & " in agent at line number:" &Str$(Erl) & ": " & Error$
End Sub