Moin zusammen,
vielen Dank für die Unterstützung. Der Code ist fertig und funktioniert einwandfrei.
Termin wird bei Import:
als privat gekennzeichnet
und mit einer Erinnerung versehen, die um 7:00 Uhr aufpoppt.
In diesem Sinne schönes Wochenende!
Sub Initialize
Dim db As notesdatabase
Dim s As New notessession
Set db = s.currentdatabase
Dim col As notesdocumentcollection
Dim doc As notesdocument
Dim caldoc As notesdocument
Dim geburtsdatum As Variant
Dim dates(9) As Variant
Dim i As Integer
Dim dummystr As String
Dim excludeFromView(1) As String
excludeFromView(0)="D"
excludeFromView(1)="S"
Dim subject As String
Dim searchcol As notesdocument
Dim erg As Variant
erg=Evaluate("@MailDbName")
Dim caldb As New NotesDatabase( "", "" )
Call caldb.Open( erg(0), erg(1) )
Set col = db.UnprocessedDocuments
Set doc = col.getfirstdocument
Do While Not doc Is Nothing
geburtsdatum = Cdat(doc.GetItemValue("birthday")(0))
dummystr= Cstr(Day(geburtsdatum))+"."+Cstr(Month(geburtsdatum))
subject="Geburtstag "+doc.Fullname(0)
Set caldoc = caldb.CreateDocument
With caldoc
.form = "Appointment"
.AltChair=s.UserName
.AppointmentType="1"
.OrgConfidential="1" .dispAlarms="1" For i = Year(Now) To Year(Now)+9
dates(i-Year(Now)) = Cdat(dummystr+"."+Cstr(i))
Next
.CalendarDateTime=dates
.EndDateTime=dates
.ExcludeFromView=excludeFromView
.MeetingType="1"
.OrgTable="A0"
.RepeatInstanceDates=dates
.Repeats="1"
.SchedulerSwitcher="1"
.SequenceNum=1
.Startdatetime=dates
.txtNum="10"
.subject=subject
.body=Cstr(geburtsdatum)
Call caldoc.ReplaceItemValue("$AlarmOffset", 420) Call .ComputewithForm(False,False)
Call .save(False,False)
End With
Set doc = col.GetNextDocument(doc)
Call caldoc.PUTINFOLDER ("$Alarms", False) Loop
End Sub