DoctorGonzo
Programmer
Hi all,
I am still trying to get to grips with LotusScript and would really appreciate some advice?
I am tyring to write an agent to run daily, which will check a date field (ExpiryDate), and if that date = today, then move (or copy then delete) these documents to database number 2.
I've been looking at this code, but am unsure about how to modify it really
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
Dim server As String
server = db.Server
Dim Db2 As New NotesDatabase(server,"CopyTest2.nsf")
Dim doc As NotesDocument
Dim view As NotesView
Set view = db.GetView("Testview")
Set doc = view.GetFirstDocument
Do Until doc Is Nothing
** I think this is where I put the IF EXPIRYDATE = TODAY code??? how to MOVE rather than COPY though?
Call doc.CopyToDatabase( Db2)
** OTHERWISE/ELSEIF....
Set doc=view.GetNextDocument(doc)
Loop
Please can someone kindly advise a novice?
Many many thanks,
Gonzo
I am still trying to get to grips with LotusScript and would really appreciate some advice?
I am tyring to write an agent to run daily, which will check a date field (ExpiryDate), and if that date = today, then move (or copy then delete) these documents to database number 2.
I've been looking at this code, but am unsure about how to modify it really
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
Dim server As String
server = db.Server
Dim Db2 As New NotesDatabase(server,"CopyTest2.nsf")
Dim doc As NotesDocument
Dim view As NotesView
Set view = db.GetView("Testview")
Set doc = view.GetFirstDocument
Do Until doc Is Nothing
** I think this is where I put the IF EXPIRYDATE = TODAY code??? how to MOVE rather than COPY though?
Call doc.CopyToDatabase( Db2)
** OTHERWISE/ELSEIF....
Set doc=view.GetNextDocument(doc)
Loop
Please can someone kindly advise a novice?
Many many thanks,
Gonzo