Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim docResp As NotesDocument
Dim AdminRead As NotesItem
Dim AllReader As NotesItem
Dim AllRoles As NotesItem
Dim UserAutor As NotesItem
Dim uComment As NotesItem
Dim typeTM As NotesItem
Dim datAnlage As NotesItem
Dim item As NotesItem
Set db = session.CurrentDatabase
Set doc = db.GetDocumentByUNID( baseID ) 'Zugehöriges Hauptdokument
Set docResp = db.CreateDocument
docResp.Form = "Kommentar"
Set item = doc.GetFirstItem("gwflow_ReaderResp")
item.IsReaders= True 'Für die Zugriffssteuerung auf die Kommentardokumente Textliste in ReaderListe wandeln
Call item.CopyItemToDocument(docResp, "gwflow_resp_ReaderWF")
item.IsReaders= False 'Zurücksetzen der Änderung
Set item = doc.GetFirstItem("gwflow_LeserImmer")
Call item.CopyItemToDocument(docResp, "gwflow_resp_ReaderRoles")
Set UserAutor = New NotesItem( docResp, "gwflow_resp_Ersteller", readerUser , AUTHORS)
Set uComment = New NotesItem( docResp, "gwflow_resp_Kommentar", comment)
Set datAnlage = New NotesItem( docResp, "gwflow_resp_AnlageDat", Today)
Select Case aktNr
Case "1":
Set typeTM = New NotesItem( docResp, "gwflow_resp_TypTM", "TM_gwflow_resp_Stellung")
Case "2":
Set typeTM = New NotesItem( docResp, "gwflow_resp_TypTM", "TM_gwflow_resp_Stellung")
Case "4":
Set typeTM = New NotesItem( docResp, "gwflow_resp_TypTM", "TM_gwflow_resp_Vstd")
Set VoteVstd = New NotesItem( docResp, "gwflow_resp_Entscheidung", voteVstd)
Case "6":
Set typeTM = New NotesItem( docResp, "gwflow_resp_TypTM", "TM_gwflow_resp_BR")
Set VoteVstd = New NotesItem( docResp, "gwflow_resp_Votum", voteBR)
Case "8":
Set typeTM = New NotesItem( docResp, "gwflow_resp_TypTM", "TM_gwflow_resp_Vstd")
Set VoteVstd = New NotesItem( docResp, "gwflow_resp_Entscheidung", voteVstd)
Case Else
Set typeTM = New NotesItem( docResp, "gwflow_resp_TypTM", "ups")
End Select
'Speichern, zum Antwortdokument machen und erneut speichern
Call docResp.Save( True, False )
Call docResp.MakeResponse( doc )
Call docResp.Save( True, False )