Das ist ja schon mein Import Agent, der ja auch funzt. Aber beim Suchen da happert es genau.
Sub Initialize
Dim session As New notessession
Dim db As notesdatabase
Dim doc As notesdocument
Dim fileNum As Integer, cells As Integer, k As Long
Dim fileName As String
Dim InputStr As String, delimiter As String
Dim FieldArray As Variant
Set db = session.currentdatabase
fileNum% = Freefile()
' Dateipfad
fileName$ = "C:\Ordner 123\123\test.csv"
' Trennzeichen
delimiter = ";"
Open fileName$ For Input As fileNum%
Line Input #1, InputStr$
Do While Not Eof(fileNum%)
' Zeile für Zeile einlesen
Line Input #1, InputStr$
FieldArray = Split(InputStr$,delimiter)
Call CreateDocument(db, FieldArray)
Loop
Close fileNum%
Exit Sub
End Sub
Sub CreateDocument(db As notesdatabase, FieldArray As Variant)
Dim doc As New notesdocument(db)
doc.Form = "Auftrag"
doc.Name = FieldArray(0)
doc.Nummer = FieldArray(1)
doc.erledigt = FieldArray(2)
Call doc.save(1,0)
End Sub
Das ist aus der Hilfe:
' Display the contents of c:\config.sys a line at a time.
Dim text As String, fileNum As Integer
fileNum% = FreeFile()
Open "c:\config.sys" For Input As fileNum%
Do While Not EOF(fileNum%)
Line Input #fileNum%, text$
Print text$ ' Prints one line of config.sys
Loop
Close fileNum%
Dann musst Du Dir die Sachen besorgen die Du brauchst, damit das Doc suchen und ändern.