Hallo mangler,
habe so etwas ähnliches über einen Agenten gelöst. Allerdings wirst du Jahreszahlen brauchen, du musst also schon abfragen für wie viele Jahre der Termin Eingetragen werden soll. Mir war das zuviel Arbeit, deshalb erstellen ich einfach einen Termineintrag und lasse den Rest vom User erledigen (Wiederholungen etc.)
gruss KlaSpa
Option Public
Use "MailLibrary"
''Deklarations MailLibrary
Dim ws As NotesUIWorkspace
Dim session As NotesSession
Dim db As NotesDatabase
Dim maildb As NotesDatabase
Dim note As NotesDocument
Dim mailnote As NotesDocument
Dim collection As NotesDocumentCollection
Dim profile As NotesDocument
Sub InstantiateVariables
Set ws = New NotesUIWorkspace
Set session = New NotesSession
Set db = session.CurrentDatabase
Set maildb = New NotesDatabase("","")
maildb.OpenMail
Set profile = maildb.GetProfileDocument("CalendarProfile")
counter = 0
Set collection = db.UnprocessedDocuments
End Sub
'''''ENDE
'AGENTEN CODE
Sub Initialize
Dim nMinutes As Integer
Dim nSeconds As Integer
Dim x As Integer
Dim startdt As NotesDateTime
Dim enddt As NotesDateTime
Dim trdr As NotesDateRange
InstantiateVariables
If (collection.Count = 0) Then
Messagebox "Es wurden keine Dokumente ausgewählt.",0,"Fehler"
Exit Sub
End If
'Kann nur einen Eintrag erstellen
Set note = collection.GetFirstDocument
'Das hier muss angepast werden
If Ucase(note.MType(0)) <> "PROJEKT" Then Exit Sub
Set mailnote = New NotesDocument(maildb)
mailnote.EnterSendTo = ""
mailnote.Form = "Appointment" <<<<<<<<<<
mailnote.AppointmentType = "0"
mailnote.Chair = profile.Owner(0)
mailnote.Principal = profile.Owner(0)
mailnote.Subject = note.DokName(0) <<<<<<<<<<
Set itemA = note.GetFirstItem( "Body" )
Call itemA.CopyItemToDocument( mailnote, "" )
Set item = note.GetFirstItem( "AmUm" ) <<<<<<<<
Set startdt = item.DateTimeValue
nMinutes = Minute(startdt.LSLocalTime)
nSeconds = 0 - Second(startdt.LSLocalTime)
startdt.AdjustSecond(nSeconds)
Set mailnote.StartDate = startdt
Set mailnote.StartDateTime = startdt
Set item = note.GetFirstItem( "EndeUm" ) <<<<<<<<
Set enddt = item.DateTimeValue
Set trdr = session.CreateDateRange
Set trdr.StartDateTime = startdt
Set trdr.EndDateTime = enddt
Set mailnote.TimeRange = trdr
Set mailnote.EndDate = enddt
Set mailnote.EndDateTime = enddt
Call ws.EditDocument(True,mailnote)
End Sub