Ya,
du hast Recht.
Der Script ist aber unter Script Bibliotheken. Die Default-User (Autor=Dokumente erstellen-Öffentliche Dokumente lesen) können nicht darauf zugreifen. Lässt sich das irgendwie einrichten, dass die User nur auf Ihre eigenen Meldungen Zugriff haben?
Danke
Sub CalculateDays
Dim session As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim doc As NotesDocument
Dim uidoc As NotesUIDocument
Dim startdate As NotesDateTime
Dim enddate As NotesDateTime
Dim startitem As NotesItem
Dim enditem As NotesItem
Dim counter As Integer
Dim flag As Integer
Dim days As Integer
'Few new dims
Dim hookdoc As NotesDocument
Dim hookview As NotesView
Dim db As NotesDatabase
Dim duration() As String
Set db = session.CurrentDatabase
Set uidoc = workspace.CurrentDocument
Set doc = uidoc.Document
If workspace.DialogBox("EDChange", True, True, False, False, False, False, "Bitte wählen Sie das Start- und Enddatum aus.") Then
doc.Counter = 2
'if either field is empty don't do calculations and blank out days field.
If doc.StartDate(0) = "" Or doc.EndDate(0) = "" Then
doc.TotalDays = ""
End
End If
Set startitem = doc.GetFirstItem("StartDate")
Set startdate = startitem.DateTimeValue
Set enditem = doc.GetFirstItem("EndDate")
Set enddate = enditem.DateTimeValue
counter = 0
'Make sure that the start date is before the end date
If startdate.TimeDifference(enddate) > 0 Then
Messagebox "The Start Date cannot come after the End Date.", 16, "Incorrect Dates"
Call uidoc.GoToField("StartDate")
End
End If
'Get the list of Holidays
Set hookview = db.GetView("Holidays")
Set hookdoc = hookview.GetDocumentByKey("Holidays",True)
Do While startdate.TimeDifference(enddate) <= 0 'Once we check the end date we're done!!
flag = 0
days = Weekday(startdate.LSLocalTime)
If days <> 1 And days <> 7 Then
'check for holidays
Forall holiday In hookdoc.AllHolidays
If Cdat(holiday) = startdate.LSLocalTime Then flag=1
End Forall
If flag =0 Then
Redim Preserve duration(0 To counter)
duration(counter) = startdate.LSLocalTime
counter = counter +1
End If
End If
Call startdate.AdjustDay(1)
Loop
doc.TotalDays = counter
doc.Duration = duration
Call uidoc.Refresh
End If
End Sub