' Wohin kommt das SerienbriefDokument
Dim Pfad As String
Pfad = "c:\\temp\\test1\\1.txt"
Dim LISTE List As String
Dim key As String
Set session = New notessession
Set db=session.currentdatabase
Set Collection=db.UnprocessedDocuments
Set doc=Collection.GetFirstDocument
key = doc.e4fldDokArt(0)
Messagebox key
Dim s As New NotesSession
Dim view As NotesView
Dim tmpdoc As NotesDocument
Set view = s.Currentdatabase.GetView( "e4vwFallgruppen" )
Dim dc As NotesDocumentCollection
Set dc = view.GetAllDocumentsByKey(key, True)
Set doc = dc.getfirstdocument
Dim temp As Integer
temp=Freefile()
Open Pfad$ For Output As temp
Print #temp,"Identnummer,HR_Nummer,RegAbt,Regger,Name1,Name2,Name3,Name4,Strasse,Hausnummer,Postfach,Postleitzahl,Ort"
While Not (doc Is Nothing)
If Iselement(LISTE(doc.e4fldIdentnummer(0))) Then
' NIX
Else
I = I + 1
LISTE(I) = doc.e4fldIdentnummer(0)
Print #temp, doc.sf_Identnummer(0) +","+doc.sf_HR_Nummer(0)+","+doc.sf_regabt(0)+","+doc.sf_regger(0)+","+doc.sf_name1(0)+","+_
doc.sf_name2(0)+","+doc.sf_name3(0)+","+doc.sf_name4(0)+","+doc.sf_vorname(0)+","+doc.sf_nachname(0)+","+doc.sf_strasse(0)+","+_
doc.sf_hausnummer(0)+","+doc.sf_postfach(0)+","+doc.sf_Postleitzahl(0)+","+doc.sf_ort(0)
End If
Set doc = dc.GetNextDocument(doc)
Wend
End
Close temp