ein Beispiel mit einem Action button - das minimalen Anforderungen entspricht.
Sub Click(Source As Button)
Dim s As New NotesSession
Dim db As NotesDatabase
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim MailDB As New NotesDatabase( "", "" )
Dim CalNote As NotesDocument
Dim rtfBody As NotesRichTextItem
Dim styleMsg As NotesRichTextStyle
Dim NoteDate As New NotesDateTime(Now)
Call MailDB.OpenMail
If Maildb.isopen = False Then
Messagebox "Your Calendar......." ,48,"Create Task"
Exit Sub
End If
Set CalNote = New NotesDocument(maildb)
CalNote.Form = "Task"
CalNote.Subject = "Neuer Eintrag vom Chefe"
Call CalNote.ReplaceItemValue("StartDate", Notedate)
Call CalNote.ReplaceItemValue("StartDateTime", Notedate)
Call CalNote.ReplaceItemValue("DueDate", Notedate)
Call CalNote.ReplaceItemValue("DueDateTime", Notedate)
Call CalNote.ReplaceItemValue("_ViewIcon", 168)
Call CalNote.ReplaceItemValue("$CSVersion", "2")
CalNote.Chair = s.UserName
CalNote.WebDateTimeInit = "1"
CalNote.tmpOwnerHW = "0"
CalNote.Assignstate = 0
CalNote.TaskType = "1"
CalNote.dueState = 1
CalNote.Importance = "2"
Set rtfBody = CalNote.CreateRichTextItem( "Body" )
Call rtfBody.AppendDocLink(ws.CurrentDocument.document, s.currentDatabase.title)
Call rtfBody.AddNewLine(1)
Set styleMsg = s.createRichTextStyle()
styleMsg.bold = True
styleMsg.fontsize = 16
styleMsg.NotesColor = 10
Call rtfBody.appendStyle(styleMsg)
Call rtfBody.AppendText("... Termin beim Zahnarzt! ")
Call CalNote.ComputeWithForm(True, True)
Call CalNote.Save(True, False)
Call CalNote.ReplaceItemValue("ApptUNID", CalNote.UniversalID)
Call CalNote.Save(True, False)
'' Set uidoc= ws.EditDocument(True,CalNote)
End Sub
cu