DoctorGonzo
Programmer
Hi All,
I am trying to write an agent which runs on a selected document in a view.
When run, it will modify two readers fields on the document and then save.
Here is what I have up to now, but I am having trouble getting a handle to the document I wish to modify, and the help is a little hard for me to understand! Just need pointing in the right direction!
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
Dim view As NotesView
Set view = db.GetView("Alldocs")
*** THIS IS THE BIT WHERE I WANT TO SELECT THE DOC :
I know there's no such thing as getcurrentdocument, but wanted to give you the idea...
Dim doc As NotesDocument
Set doc = view.getcurrentdocument
Dim firstreaders As notesitem
Set firstreaders = doc.getfirstitem("FirstReaders")
firstreaders.IsReaders = True
Dim secondreaders As notesitem
Set secondreaders = doc.getfirstitem("secondReaders")
secondreaders.IsReaders = True
*** DO I NEED A doc.save here?
End Sub
Many thanks guys,
Gonzo
I am trying to write an agent which runs on a selected document in a view.
When run, it will modify two readers fields on the document and then save.
Here is what I have up to now, but I am having trouble getting a handle to the document I wish to modify, and the help is a little hard for me to understand! Just need pointing in the right direction!
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
Dim view As NotesView
Set view = db.GetView("Alldocs")
*** THIS IS THE BIT WHERE I WANT TO SELECT THE DOC :
I know there's no such thing as getcurrentdocument, but wanted to give you the idea...
Dim doc As NotesDocument
Set doc = view.getcurrentdocument
Dim firstreaders As notesitem
Set firstreaders = doc.getfirstitem("FirstReaders")
firstreaders.IsReaders = True
Dim secondreaders As notesitem
Set secondreaders = doc.getfirstitem("secondReaders")
secondreaders.IsReaders = True
*** DO I NEED A doc.save here?
End Sub
Many thanks guys,
Gonzo