例: NotesAgent class

  1. 次のスクリプトは現在のデータベースで Cleansing エージェントを検索して、エージェントオブジェクトに割り当てます。このスクリプトは NotesDatabase で定義された Agents プロパティを使用します。
    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. 次のエージェントスクリプトは、現在のエージェントを取得し、エージェントオブジェクトに設定した後、そのエージェントの名前を取得します。例えば、このスクリプトが Ticket エージェントの一部として実行されたときには Name プロパティは「Ticket」を返します。
    Dim session As New NotesSession
    Dim agent As NotesAgent
    Dim n As String
    Set agent = session.CurrentAgent
    n = agent.Name