How to define document for Act On Selected Document Agent(Script)

I've defined an agent to 'Act on Selected Document/Manually from Menu', I want to use script for this agent. How to define the document variable for me to act on it's fields for those document user selected?
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

AntonysinghConnect With a Mentor Commented:
Hi jiayiloo,

You can get the selected document in a document collection by using database's unprocesseddocument property, then you can modified whatever fields you want from the document collecton.

See the example code,
              Dim se As New notessession
      Dim db As notesdatabase
      Dim doc As notesdocument
      Dim view As notesview
      Dim coll As notesdocumentcollection
      Set db = se.currentdatabase
      Set view = db.getview("All")
      Set coll = db.unprocesseddocuments

              Here the coll hold the selected documents and then you add your code here.

jiayilooAuthor Commented:
It works...
Bravo..... Thks very much Antony!
All Courses

From novice to tech pro — start learning today.