Hallo Leute,
ich habe einen Agent laufen, der eine View in eine txt-File exportiert.
Im Moment läuft er ohne Probleme nur wollte ich jetzt erreichen, dass nicht mehr alle Dokumente in der View exportiert werden sondern nur noch die Dokumente, die geändert wurden oder neu sind.
Ich hab das mit der Laufzieleinstellung im Agentmenü versucht, hat aber leider nicht funktioniert.
Habt ihr ne Idee wie es klappen könnte?
Dank euch
Der Agentscript sieht im Moment so aus:
Sub Initialize
Const textfile$ = "Speichertort der File"
Const fldDelim% = 59 '
Dim session As NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim lastCol As Integer
Dim colCnt As Integer
Dim txt As String
Dim fileNum As Integer
Dim docCnt As Integer '
Set session = New NotesSession
Set db = session.CurrentDatabase
Set view = db.GetView("all")
Call view.Refresh 'Ansicht aktualisieren, damit der aktuellste Stand exportiert wird
view.AutoUpdate = False 'damit keine eventuellen Aktualisierungen dazwischenfunken
lastCol = Ubound(view.Columns)
colCnt = 0
txt = ""
fileNum% = Freefile()
If Dir$(textfile, 0) <> "" Then
Kill textfile
End If
Open textfile For Output As fileNum%
Set doc = view.GetFirstDocument
docCnt = 0
While Not (doc Is Nothing)
txt = ""
For colCnt = 0 To lastCol Step 1
txt = txt + doc.ColumnValues(colCnt)
If (colCnt <> lastCol) Then
txt = txt + Chr$(59)
' Semikolon
End If
Next
Print #fileNum%, txt
docCnt = docCnt + 1
Set doc = view.GetNextDocument(doc)
Wend
Close fileNum%
End Sub
Alles anzeigen