Examples: Target property

  1. This script indicates whether or not the current agent works on all documents in the database.
    Dim session As New NotesSession
    Dim agent As NotesAgent
    Set agent = session.CurrentAgent
    If agent.Target = TARGET_ALL_DOCS Then
      Messagebox "This agent works on all docs."
    Else
      Messagebox "This agent does not work on all docs."
    End If
  2. This script determines the target of the current agent and displays the result.
    Dim session As New NotesSession
    Dim agent As NotesAgent
    Dim db As NotesDatabase
    Set agent = session.CurrentAgent
    targetDoc = agent.Target
    Select Case targetDoc
    Case TARGET_ALL_DOCS : targetDoc = "all documents."
    Case TARGET_NEW_DOCS : targetDoc = "new documents."
    Case TARGET_NEW_OR_MODIFIED_DOCS : targetDoc =  _
    "new or modified documents."
    Case TARGET_SELECTED_DOCS : targetDoc = "selected documents."
    Case TARGET_ALL_DOCS_IN_VIEW : targetDoc = _
    "all documents in view."
    Case TARGET_UNREAD_DOCS_IN_VIEW : targetDoc = _
    "unread documents in view."
    Case TARGET_NONE : targetDoc = "none."
    End Select
    Messagebox "The target of this agent is " & targetDoc