Hey Leute ich bins mal wieder,
ich hab einen Agent erstellt mit Hilfe von euch. Der soll eine Ansicht in eine Text File exportieren. Die Datei soll auf einen Server hinterlegt werden.
Wenn der Agent folgende Einstellungen hat, dann läuft er:
Auswahl im Menü Aktionen
Alle Dokumente in der Ansicht
Wenn der Agent durch einen Zeitplan laufen soll tut sich nichts.
Habt ihr ne Idee was das sein könnte?
Der Code sieht wie folgt aus:
Sub Initialize
Const textfile$ = "\\Server\Nipson_versand\huhu.txt"
Const fldDelim% = 9 '
Dim session As NotesSession
Dim db As NotesDatabase
Dim ws As New notesuiworkspace
Dim uiview As notesuiview
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 uiview = ws.currentview
'Set view = db.GetView("Export")
Set view = uiview.view
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$(fldDelim)
End If
Next
Print #fileNum%, txt
docCnt = docCnt + 1
Set doc = view.GetNextDocument(doc)
Wend
Close fileNum%
End Sub