Ich hab ein kleines Problem mit diesem Agent!!!
Er funktioniert nicht richtig!!! Erst wenn ich im Designer in den Agent reingehe und dann speichern sag dann versendet er mir mails er soll aber jede nacht laufen!
Kann mir wer helfen und mir sagen was ich falsch gemacht habe!
Danke robertpp
Dim s As New NotesSession
Dim db As NotesDatabase
Set db = s.CurrentDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim memo As NotesDocument
Dim rtitem As NotesRichTextItem
Dim umstellgrund As String
Set view=db.GetView("To Do")
Set doc=view.GetFirstDocument
Do Until doc Is Nothing
If Isempty (doc.Umstellungsgrund) Then
umstellgrund =" "
Else
umstellgrund = doc.Umstellungsgrund(0)
End If
If doc.Status(0) = "1.) new" Or doc.Status(0) = "2.) in work" Then
If doc.EndTime(0) +1 = Date Then
Set memo =db.CreateDocument
With memo
.Form="Memo"
.Subject="To Do entry ''"+ doc.beschreibung(0) + "'' to finish"
.SendTo=doc.who
Set rtitem = memo.CreateRichTextItem( "Body" )
Call rtitem.AppendText("Your To-Do-entry ''" + doc.beschreibung(0) + "'' should have been finished until today. Please finish the job or make an update of the enddate ")
Call rtitem.AddNewLine(2)
Call rtitem.AppendText("Subject: "+ umstellgrund+ "")
Call rtitem.AddNewLine(2)
Call rtitem.AppendDocLink(doc,doc.beschreibung(0))
Call memo.Send(False)
End With
Delete memo
Set memo =db.CreateDocument
With memo
.Form="Memo"
.Subject="To Do entry ''"+ doc.beschreibung(0) + "'' to finish"
.SendTo=doc.whom
Set rtitem = memo.CreateRichTextItem( "Body" )
Call rtitem.AppendText("The To-Do-entry ''" + doc.beschreibung(0) + "'' from ''" + doc.who(0) + "'' should have been finished until today")
Call rtitem.AddNewLine(2)
Call rtitem.AppendText("Subject: "+ umstellgrund+ "")
Call rtitem.AddNewLine(2)
Call rtitem.AppendDocLink(doc,doc.beschreibung(0))
Call memo.Send(False)
End With
Delete memo
Elseif doc.EndTime(0) = Date Then
Set memo =db.CreateDocument
With memo
.Form="Memo"
.Subject="To Do entry ''"+ doc.beschreibung(0) + "'' to finish"
.SendTo=doc.who
Set rtitem = memo.CreateRichTextItem( "Body" )
Call rtitem.AppendText("Don't forget to finish your todo-entrie ''" + doc.beschreibung(0) + "'' today ")
Call rtitem.AddNewLine(2)
Call rtitem.AppendText("Subject: "+ umstellgrund+ "")
Call rtitem.AddNewLine(2)
Call rtitem.AppendDocLink(doc,doc.beschreibung(0))
Call memo.Send(False)
End With
Delete memo
End If
End If
Set doc=view.getnextdocument(doc)
Loop
End Sub