Hallo,
ich versuche einen mehrtägigen Kalendereintrag zu erzeugen.
Zu Anfang meiner Versuche wurde der Eintrag erzeugt, bzw. war auffindbar, wenn auch nicht mit allen korrekten Werten.
Mittlerweile wird das Script aber ohne Fehler ausgeführt, aber der Eintrag ist nirgends auffindbar.
Hat da jemand vielleicht eine Idee?
Variablen, die mit arg.. beginnen, werden als Parameter übergeben.
Code
Dim s As New NotesSession
Dim db As NotesDatabase
Dim col As NotesDocumentCollection
Dim doc As NotesDocument
Dim view As NotesView
Dim vc As NotesViewEntryCollection
Dim arg As String, p1 As Long
Dim argarray As Variant
Dim counter As Integer
Dim argdb As String
Dim argserver As String
Dim argaction As String
Dim argvdat As String
Dim argbdat As String
Dim argtype As String
Dim argtext As String
Dim vdate As NotesDateTime
Dim bdate As NotesDateTime
Dim starttime As String, endtime As String
Dim startDate As Variant, endDate As Variant
Dim aExcludeView(1) As String
Dim cprofile As NotesDocument
Dim mailowner As String
Dim vDates As Variant
Dim iLoop As Integer
Dim atCSWISL (0 To 4) As String
atCSWISL(0)="$S:1"
atCSWISL(1)="$L:1"
atCSWISL(2)="$B:1"
atCSWISL(3)="$R:1"
atCSWISL(4)="$E:1"
Dim atWatched (0 To 4) As String
atWatched(0)="$S"
atWatched(1)="$L"
atWatched(2)="$B"
atWatched(3)="$R"
atWatched(4)="$E"
aExcludeView(0) = "D"
aExcludeView(1) = "S"
starttime = "07:00:00"
endtime = "20:00:00"
Set db = s.GetDatabase(argserver, "mail"+argdb, False)
If Not db.IsOpen Then Call db.Open("", "")
Set cprofile = db.GetProfileDocument("CalendarProfile")
mailowner = cprofile.GetItemValue("Owner")(0)
Set view = db.GetView("Calendar")
Set doc = db.Createdocument()
docid = doc.UniversalID
doc.form = "Appointment"
doc.Subject = argtext
doc.Location = " "
doc.SequenceNum = "1"
startdate = CDat(argvdat)
enddate = CDat(argbdat)
doc.StartDate = startDate
doc.StartTime = startDate
doc.StartDateTime = startDate
doc.EndDate = endDate
doc.EndTime = endDate
iLoop = endDate - startDate
ReDim vDates (0 To iLoop)
vDates (0) = startDate
For iLoop = 1 To UBound (vDates)
vDates (iLoop) = startDate + iLoop
Next
doc.Repeats = "1"
doc.RepeatFor = iLoop
doc.RepeatHow = "F" ' U=repeat until, F=repeat for
doc.RepeatForUnit = "D" ' repeat in days (W=weekly,M=monthly,Y=yearly)
doc.RepeatWeekends = "D" ' Do nothing if on a weekend
doc.RepeatUnit = "D"
doc.RepeatInterval = "1" ' dayly
doc.RepeatAdjust = "1" ' only used if weekly or monthly
doc.RepeatStartDate = startdate
doc.RepeatDates = vDates
doc.ExcludeFormView = aExcludeView
doc.MeetingType = "1"
doc.AppointmentType = argtype
doc.MessageType = "Not a draft"
doc.Logo = "StdNotesLtr3"
doc.AppointmentType = argtype
doc.OrgTable = "P0"
doc.SchedulerSwitcher = "1"
doc.Notes = ""
doc.Body = "Erzeugt durch den Urlaubsplaner im Intranet.**ID=" & docid & "**" & argtext
doc.~_ViewIcon = "9"
doc.EndTimeZone = "Z=-1$DO=1$DL=3 -1 1 10 -1 1$ZX=71$ZN=W. Europe"
doc.StartTimeZone = "Z=-1$DO=1$DL=3 -1 1 10 -1 1$ZX=71$ZN=W. Europe"
doc.UpdateSeq = 1
doc.WebDateTimeInit = 1
doc.~$AlarmDiabled = "1"
doc.~$PublicAccess = "1"
doc.~$CSWISL = atCSWISL
doc.~$WatchedItems = atWatched
doc.~$CSFlags = "m"
doc.OrgRepeat = "1"
doc.~$CSVersion = "2"
doc.Chair = mailowner
doc.AltChair = mailowner
doc.From = mailowner
doc.Principal = mailowner
If argtype = "2" Then
doc.BookFreeTime = "0"
doc.~$BusyName = mailowner
doc.~$BusyPriority = "1"
End If
doc.ApptUNID = docid
Call doc.Save( True, True )
ErrResume:
Exit Sub
ErrHandler:
Print "** CalendarTasks ** Error occured " & Str(Err) & ": " & Error$ & " in line " & Str(Erl) & ". Agent stopped."
Resume ErrResume
Alles anzeigen