Greetings everyone,
I’m trying to copy an agent from one Notes database to another Notes Database using the NotesNoteCollection. But I’m getting a notes error message “The specified note or note does not exist in the collections’s parent database”.
Here is the code:
Dim nc As NotesNoteCollection
Dim ncTW As NotesNoteCollection
Dim db As New NotesDatabase(“”,“”)
Dim dbTeamWorks As New NotesDatabase(“”,“”)
Dim agent As NotesAgent
Dim doc As NotesDocument
Call dbTeamWorks.OpenByReplicaID(“R5DEV03”,“852570AE00610F96”)
Call db.OpenMail
Set nc = db.CreateNoteCollection(False)
nc.SelectAgents = True
Call nc.BuildCollection
Set ncTW = dbTeamworks.CreateNoteCollection(False)
ncTW.SelectAgents = True
ncTW.SelectionFormula = “$TITLE=”“Copy Documents to TeamWorks”“”
Call ncTW.BuildCollection
nid = ncTW.GetFirstNoteId
Set doc = dbTeamWorks.GetDocumentByID(nid)
Call nc.Add(doc)
Any Help would be greatly appreciated.
Thanks,
Oscar J. Kerrebyn