Domino 9 und frühere Versionen > Entwicklung
Feiertage im Kalender eintragen
Felix:
Hallo zusammen,
habe eine DB gefunden die Feiertage im Kalender von Notes 4.6.x eintragen soll. Ich habe das verwendete Script auf die Tage in 2002 geändert und bekomme beim ausführen immer die Fehlermeldung "zu viele Fenster offen" !! Kann jemand weiterhelfen ??
Felix
Das Script des Buttons:
REM Quick and dirty code to add business holidays to the user's calendar
REM This code will add your business holidays to the user's calendar by using front end classes and allowing the form's built in funtionality to handle the validation
Sub Click(Source As Button)
Dim session As New NotesSession
Dim db As New NotesDatabase ("","")
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim userName As New notesname(session.username)
Dim dbfilename As String
Dim dbserver As String
Dim value As Integer
Call db.OpenMail
dbfilename=db.filepath
dbserver = db.server
value = Messagebox ("Möchten Sie die Feiertage 2002 " + Chr(10) + "zu Ihrem Kallender hinzufügen?", (4+32+0+0), "Add HolidaysTo Calendar")
If (value = 6) Then
'*****************Do this chunk of code for each holiday in the year**************************
Set uidoc = ws.ComposeDocument (dbserver,dbfilename,"Appointment")
Call uidoc.FieldSetText("Subject","Neujahr")
Call uidoc.FieldSetText("StartDate","01.01.2002")
Call uidoc.FieldSetText("AppointmentType","2")
Call uidoc.Save()
Call uidoc.Close()
'****************************************************************************************************
'*****************Do this chunk of code for each holiday in the year**************************
Set uidoc = ws.ComposeDocument (dbserver,dbfilename,"Appointment")
Call uidoc.FieldSetText("Subject","Heilige Dreikönige")
Call uidoc.FieldSetText("StartDate","06.01.2002")
Call uidoc.FieldSetText("AppointmentType","2")
Call uidoc.Save()
Call uidoc.Close()
'****************************************************************************************************
'*****************Do this chunk of code for each holiday in the year**************************
Set uidoc = ws.ComposeDocument (dbserver,dbfilename,"Appointment")
Call uidoc.FieldSetText("Subject","Karfreitag")
Call uidoc.FieldSetText("StartDate","29.03.2002")
Call uidoc.FieldSetText("AppointmentType","2")
Call uidoc.Save()
Call uidoc.Close()
'****************************************************************************************************
'*****************Do this chunk of code for each holiday in the year**************************
Set uidoc = ws.ComposeDocument (dbserver,dbfilename,"Appointment")
Call uidoc.FieldSetText("Subject","Ostersonntag")
Call uidoc.FieldSetText("StartDate","31.03.2002")
Call uidoc.FieldSetText("AppointmentType","2")
Call uidoc.Save()
Call uidoc.Close()
'****************************************************************************************************
'*****************Do this chunk of code for each holiday in the year**************************
Set uidoc = ws.ComposeDocument (dbserver,dbfilename,"Appointment")
Call uidoc.FieldSetText("Subject","Ostermontag")
Call uidoc.FieldSetText("StartDate","01.04.2002")
Call uidoc.FieldSetText("AppointmentType","2")
Call uidoc.Save()
Call uidoc.Close()
'****************************************************************************************************
'*****************Do this chunk of code for each holiday in the year**************************
Set uidoc = ws.ComposeDocument (dbserver,dbfilename,"Appointment")
Call uidoc.FieldSetText("Subject","Tag der Arbeit")
Call uidoc.FieldSetText("StartDate","01.05.2002")
Call uidoc.FieldSetText("AppointmentType","2")
Call uidoc.Save()
Call uidoc.Close()
'****************************************************************************************************
'*****************Do this chunk of code for each holiday in the year**************************
Set uidoc = ws.ComposeDocument (dbserver,dbfilename,"Appointment")
Call uidoc.FieldSetText("Subject","Christi Himmelfahrt")
Call uidoc.FieldSetText("StartDate","09.05.2002")
Call uidoc.FieldSetText("AppointmentType","2")
Call uidoc.Save()
Call uidoc.Close()
'****************************************************************************************************
'*****************Do this chunk of code for each holiday in the year**************************
Set uidoc = ws.ComposeDocument (dbserver,dbfilename,"Appointment")
Call uidoc.FieldSetText("Subject","Pfinstsonntag")
Call uidoc.FieldSetText("StartDate","19.05.2002")
Call uidoc.FieldSetText("AppointmentType","2")
Call uidoc.Save()
Call uidoc.Close()
'****************************************************************************************************
'*****************Do this chunk of code for each holiday in the year**************************
Set uidoc = ws.ComposeDocument (dbserver,dbfilename,"Appointment")
Call uidoc.FieldSetText("Subject","Pfinstmontag")
Call uidoc.FieldSetText("StartDate","20.05.2002")
Call uidoc.FieldSetText("AppointmentType","2")
Call uidoc.Save()
Call uidoc.Close()
'****************************************************************************************************
'*****************Do this chunk of code for each holiday in the year**************************
Set uidoc = ws.ComposeDocument (dbserver,dbfilename,"Appointment")
Call uidoc.FieldSetText("Subject","Tag der deutschen Einheit")
Call uidoc.FieldSetText("StartDate","03.10.2002")
Call uidoc.FieldSetText("AppointmentType","2")
Call uidoc.Save()
Call uidoc.Close()
'****************************************************************************************************
'*****************Do this chunk of code for each holiday in the year**************************
Set uidoc = ws.ComposeDocument (dbserver,dbfilename,"Appointment")
Call uidoc.FieldSetText("Subject","Allerheiligen")
Call uidoc.FieldSetText("StartDate","01.11.2002")
Call uidoc.FieldSetText("AppointmentType","2")
Call uidoc.Save()
Call uidoc.Close()
'****************************************************************************************************
'*****************Do this chunk of code for each holiday in the year**************************
Set uidoc = ws.ComposeDocument (dbserver,dbfilename,"Appointment")
Call uidoc.FieldSetText("Subject","Weihnachten")
Call uidoc.FieldSetText("StartDate","24.12.2002")
Call uidoc.FieldSetText("AppointmentType","2")
Call uidoc.Save()
Call uidoc.Close()
'****************************************************************************************************
'*****************Do this chunk of code for each holiday in the year**************************
Set uidoc = ws.ComposeDocument (dbserver,dbfilename,"Appointment")
Call uidoc.FieldSetText("Subject","1. Weihnachtsfeiertag")
Call uidoc.FieldSetText("StartDate","25.12.2002")
Call uidoc.FieldSetText("AppointmentType","2")
Call uidoc.Save()
Call uidoc.Close()
'****************************************************************************************************
'*****************Do this chunk of code for each holiday in the year**************************
Set uidoc = ws.ComposeDocument (dbserver,dbfilename,"Appointment")
Call uidoc.FieldSetText("Subject","2. Weihnachtsfeiertag")
Call uidoc.FieldSetText("StartDate","26.12.2002")
Call uidoc.FieldSetText("AppointmentType","2")
Call uidoc.Save()
Call uidoc.Close()
'****************************************************************************************************
'*****************Do this chunk of code for each holiday in the year**************************
Set uidoc = ws.ComposeDocument (dbserver,dbfilename,"Appointment")
Call uidoc.FieldSetText("Subject","Silvester")
Call uidoc.FieldSetText("StartDate","31.12.2002")
Call uidoc.FieldSetText("AppointmentType","2")
Call uidoc.Save()
Call uidoc.Close()
'****************************************************************************************************
Messagebox ("Kalender wurde mit den Feiertagen 2002 upgedatet.")
Else
Messagebox ("Calendar not changed.")
End If
End Sub
doliman:
Hi,
versuch mal statts der vielen uidoc einfach mit backend doc zu arbeiten. Falls Du eine Mailschablone vom Lotus Client 5 hast, dort ist ein Agent drin der das gleiche macht.
Felix:
Danke für die Antwort,
das stellt sich mir die Frage wie nutze ich das Backend ??
Bin nicht der versierte Programmierer
Felix
Andysun:
kannst du nicht die Dokumente aus der DB markieren + kopieren und über den AdminClient unter \Konfiguration\Verschiedenes\Feiertage einfügen.
Ich glaube das geht auch.
Gruss
Andreas
Felix:
Hallo Andysun,
leider besteht nicht die Möglichkeit (oder doch) bei 700 DAUS das händisch durchzuführen.
Gruss Felix ;D ;D ;D
Navigation
[0] Themen-Index
[#] Nächste Seite
Zur normalen Ansicht wechseln