Examples: NotesAgent class

  1. This script finds the Cleansing Agent in the current database and assigns it to the agent object. It uses the Agents property defined in NotesDatabase.
    Dim session As New NotesSession
    Dim db As NotesDatabase
    Dim agent As NotesAgent
    Set db = session.CurrentDatabase
    Forall a In db.Agents
      If ( a.Name = "Cleansing Agent" ) Then
        Set agent = a
        Exit Forall
      End If
    End Forall
  2. This agent script gets the current agent, puts it into the agent object, and then gets its name. For example, if this script runs as part of the Ticket agent, the Name property returns "Ticket."
    Dim session As New NotesSession
    Dim agent As NotesAgent
    Dim n As String
    Set agent = session.CurrentAgent
    n = agent.Name