Das ist schon der richtige Weg. Hab hier mal den Code der das Log füllt mit Gesprächen. Viellecht kann man dort ansetzen?
Sub Initialize
On Error Goto Debug
Dim session As New NotesSession
Dim db As NotesDatabase
Dim vwAdministration As notesview
Dim docAdministration As notesdocument
Dim strPath As String
Dim counter As Long
Dim strLine As String
Dim fileNum As Integer
Dim docPhoneCall As notesdocument
Dim arLine() As String
Dim strTemp As String
Dim intcount As Long
Dim k As Integer
Dim dateTime1 As NotesDateTime
Dim dateTime2 As NotesDateTime
Set db = session.CurrentDatabase
Call writeLogEntry(Now, "Agent gestartet in: " + db.filename, "Action", "-", "-", "Agent: agGetPhoneCall")
' get import path
Set vwAdministration = db.GetView("vwAdministration")
Set docAdministration = vwAdministration.GetDocumentByKey("ADM",True)
fileNum% = Freefile()
Open docAdministration.fldPath(0) For Input As fileNum%
Do While Not Eof(fileNum%)
Line Input #fileNum%, strLine
intcount=0
strTemp=""
For k=1 To Len(strLine)
If Mid$(strLine,k,1)=";" Then
Redim Preserve arLine(intcount)
arLine(intcount)=strTemp
strTemp=""
intcount=intcount+1
Else
strTemp=strTemp+Mid$(strLine,k,1)
End If
Next k
Redim Preserve arLine(intcount)
arLine(intcount)=strTemp
Set docPhoneCall = db.CreateDocument
docPhoneCall.form = "frmPhoneCall"
docPhoneCall.fldCreated = Now
docPhoneCall.fldImportPeriod=docAdministration.fldImportPeriod
' 14;05;2002;15;17;287;0441361----;00;00;22;0.05;G
Set dateTime1 = New NotesDateTime( arLine(0)+"."+arLine(1)+"."+arLine(2)+" "+arLine(3)+":"+arLine(4) )
Set dateTime2 = New NotesDateTime( arLine(7)+":"+arLine(
+":"+arLine(9) )
docPhoneCall.fldDate=dateTime1.LSLocalTime
docPhoneCall.fldDuration=dateTime2.LSLocalTime
docPhoneCall.fldPhone=arLine(5)
docPhoneCall.fldPhoneNumber=arLine(6)
docPhoneCall.fldType=arLine(11)
docPhoneCall.fldCosts=Cdbl(arLine(10))
docPhoneCall.save True,True
counter = counter + 1
Print "akuteller Importsatz: " + Cstr(counter)
Loop
Call writeLogEntry(Now, "Agent beendet in: " + db.filename, "Action", "-", "-", "Agent: agGetPhoneCall")
Exit Sub
Debug:
Call writeLogEntry(Now, "", "Error", "-", "Error " & Err & " at line number" & Erl , "Agent: agGetPhoneCall")
Exit Sub
'Resume Next
End Sub