%INCLUDE "lsxbeerr.lss"
Sub Initialize
REM Archivierung...
Dim session As New NotesSession
Dim db As NotesDatabase
Dim arcdb As New NotesDatabase("","chug_kop.nsf")
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Dim doc2 As NotesDocument
Dim doc3 As NotesDocument
Dim wert As Variant
Dim wert1 As Variant
Dim wert2 As Variant
Dim wert3 As Variant
Dim wert4 As Variant
Set db = session.CurrentDatabase
Set dc = db.AllDocuments
Set doc = dc.GetFirstDocument
While Not doc Is Nothing
wert4 = doc.GetItemValue("status")
If wert4(0) = "offen" Then
REM offen und noch keine UNID vorhanden..
On Error lsERR_NOTES_ERROR Goto label1
Set doc3 = arcdb.getDocumentByUNID(doc.zuDokiD(0))
label1:
wert = doc.GetItemValue("Titel")
wert1 = doc.GetItemValue("Name")
wert2 = doc.GetItemValue("Thema")
wert3 = doc.GetItemValue("Telefonnummer")
Set doc2 = New NotesDocument( arcdb )
doc2.Form = "Task"
doc2.TaskType = "1"
doc2.Categories = "offene Telefonate"
doc2.TaskType = "1"
doc2.tmpOwnerHW = "1"
doc2.tmpNoActionBar = "1"
doc2.NoticeType = ""
doc2.~_ViewIcon = 8
doc2.Subject = wert(0) & " - " & wert1(0) & " - " & wert3(0) & " - " & wert2(0)
Call doc2.ComputeWithForm(False, False)
Call doc2.Save( True, False )
If doc2.Save( True,False ) Then Messagebox "Document " & doc.UniversalID & " successfully saved"
doc.zuDokiD = doc2.UniversalID
Call doc.Save( True, False )
Goto schleife
Schleife:
End If
Set doc = dc.GetNextDocument( doc )
Wend
End Sub