Hi,
das Beispiel hab ich in der Designer-Hilfe gefunden:
1. This agent runs the agent named "Agent to be run LotusScript."
Sub Initialize
Dim s As New NotesSession
Dim db As NotesDatabase
Dim agent As NotesAgent
Set db = s.CurrentDatabase
Set agent = db.GetAgent("Agent to be run LotusScript")
If agent.Run = 0 Then
Messagebox "Agent ran",, "Success"
Else
Messagebox "Agent did not run",, "Failure"
End If
End Sub
This is "Agent to be run LotusScript."
Sub Initialize
Dim s As New NotesSession
Dim agent As NotesAgent
Set agent = s.CurrentAgent
Dim db As NotesDatabase
Set db = s.CurrentDatabase
Dim memo As New NotesDocument(db)
memo.Form = "Memo"
memo.SendTo = s.UserName
memo.Subject = "Message from LotusScript agent"
memo.Body = "The agent is running as " & s.UserName
Call memo.Send(False)
End Sub
Axel