次のスクリプトは現在のエージェントの作用対象を特定し、結果を表示します。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