Examples: Comment property (NotesAgent - LotusScript)

  1. This script gets the comment for the agent that's currently running. For example, if this script were part of the "Archive" agent, the Comment property might return "This agent archives selected documents."
    Dim session As New NotesSession
    Dim agent As NotesAgent
    Dim c As String
    Set agent = session.CurrentAgent
    c = agent.Comment
  2. This script creates a summary of the shared, enabled agents in the current database, listing each agents name and comment. The document containing the summary is then mailed to the database managers.
    Dim session As New NotesSession
    Dim db As NotesDatabase
    Dim doc As NotesDocument
    Dim rtitem As NotesRichTextItem
    Set db = session.CurrentDatabase
    Set doc = New NotesDocument( db )
    Set rtitem = New NotesRichTextItem( doc, "Body" )
    Forall a In db.Agents
      If ( a.IsPublic And a.IsEnabled ) Then
        Call rtitem.AppendText( a.Name )
        Call rtitem.AddTab( 2 )
        Call rtitem.AppendText( a.Comment )
        Call rtitem.AddNewLine( 1 )
      End If
    End Forall
    doc.Subject = "Shared agent summary for " & db.Title
    Call doc.Send( False, db.Managers )

    For example, if there are three shared, enabled agents in the current database, the Body of the summary document might look like this:

    Archive

    This agent archives selected documents

    Phone Number

    Looks up an employee's phone number

    Total

    Calculates the total revenues for the quarter