Beiträge von sperri1

    also irgendwie komm ich nicht weiter, wenn ich die Abbruch Bedingung in der Do Until Schleife so setze wie unten im script, erzeugt er mir eine neue File nach der anderen, was ja auch verständlich ist. setze ich die Bedingung auf


    Do Until textfile1 & Cstr(fileCnt) & textfile2 > Dir$(textfile)


    passiert nichts, was ich nicht ganz verstehe. hab ich irgendwo einen denkfehler? die schleife sollte so doch solang laufen bis der erste teil größer ist wie die textfile?



    lastCol = Ubound(view.Columns)
    colCnt = 0
    txt = ""
    fileNum% = Freefile()
    fileCnt = 0

    textfile = "C:\test\test_" & Cstr(fileCnt) & ".dat"
    textfile1= "C:\test\test_"
    textfile2= ".dat"

    If Dir$(textfile) = "" Then

    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%

    Else

    Do Until textfile1 & Cstr(fileCnt) & textfile2 < Dir$(textfile)
    fileCnt = fileCnt+1

    Open textfile1 & Cstr(fileCnt) & textfile2 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%

    Loop
    End If
    Messagebox "OK", MB_OK ,"Continiune?"
    End Sub

    so der erste teil der if abfrage funktioniert jetzt aber ich hab irgend ein problem mit der schleife. der agent holt sich immer die schon existierende file und erstellt diese neu. ich bin in der script spache noch nicht so fit.


    könntet ihr mir dabei nochmal unter die arme greifen?


    lastCol = Ubound(view.Columns)
    colCnt = 0
    txt = ""
    fileNum% = Freefile()
    fileCnt = 0

    textfile = "C:\test\test_" & Cstr(fileCnt) & ".dat"
    textfile1= "C:\test\test_"
    textfile2= ".dat"

    If Dir$(textfile) = "" Then

    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%

    Else

    Do While Dir$(textfile1 & Cstr(fileCnt) & textfile2) <> textfile
    fileCnt = fileCnt+1

    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%

    Loop
    End If

    End Sub

    Hey hab jetzt folgenden Agent zusammengebaut, nur leider überschreibt dieser mir immer die test_0.dat File, auch wenn diese schon existiert.


    habt ihr vielleicht eine idee?


    Sub Initialize

    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 fileCnt As Integer
    Dim txt As String
    Dim fileNum As Integer
    Dim docCnt As Integer '
    Dim textfile As String
    Dim textfile1 As String
    Dim textfile2 As String

    Set session = New NotesSession
    Set db = session.CurrentDatabase

    Set view = db.GetView("test")

    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()
    fileCnt = 0

    textfile = "C:\test\test_0.dat"
    textfile1= "C:\test\test_"
    textfile2= ".dat"

    If Dir$(textfile, 0) = "" Then

    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%

    Else

    Do While Dir$( textfile1 & fileCnt & textfile2,0) <> Dir$(textfile,0)
    fileCnt = fileCnt+1
    Loop

    Open textfile1 & fileCnt & textfile2 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 If

    End Sub

    Hallo Leute,


    ich habe einen Export Agent laufen, der soweit auch funktioniert.
    Der Agent läuft einmal am Tag um 22 Uhr.


    Der Agent soll jetzt bei jedem Lauf eine hochzählende Datei-Endung erzeugen. Weil im Moment überschreibt er die alte Datei einfach.


    Also beim ersten Lauf = "test_1.dat" dann beim zweiten Lauf = "test_2.dat" usw.


    Hab schon überlegt wie ich das realisieren könnte, nur leider is mir nix eingefallen.


    Habt ihr eine Idee?


    Dank euch



    Der jetzige Agent sieht so aus:



    Sub Initialize

    Const textfile$ = "/test/test.dat"



    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("test")

    Call view.Refresh
    view.AutoUpdate = False


    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

    Servus Leute, ich hab en kleines Problem mit einem Excel Import.


    Ich habe einen Importagent, der mir beim Ausführen jeweils neue Dokumente erstellt. Die Felder Ko_1, Ge_1 usw. sind Zeitfelder bzw Daten. Beim Importieren macht mir der Agent Textdaten daraus.


    Es steht also 0,29.. statt 07:08 in dem Feld Ko_1. Die Daten in Excel sind Zeitdaten.


    Habt ihr ne Idee, wie ich beim Import die Daten auch als Zeit-Werte importieren kann?



    Dank euch




    Der Agent sieht folgendermaßen aus:



    Sub Initialize
    Dim session As New NotesSession
    Dim db As NotesDatabase
    Dim doc As NotesDocument

    Set db = session.CurrentDatabase

    Set xlApp = CreateObject("Excel.Application")
    xlapp.Visible = True ' Excel wird angezeigt
    xlApp.Workbooks.Open "C:\Dateiname.xls" ' Datei öffnen
    xlApp.Sheets("Tabelle1").Select ' Springe in die Tabelle "Tab 1"

    If Not db.isopen Then
    Msgbox "DB konnte nicht geöffnet werden"
    Exit Sub
    End If


    For Zeile = 2 To 10
    Set doc = New NotesDocument(db)
    doc.Form = "Dokument"
    doc.Name = xlApp.Cells( Zeile, 1).Value
    doc.Woche= xlApp.Cells( Zeile, 2).Value
    doc.Ko_1 = xlApp.Cells( Zeile, 3).Value
    doc.Ge_1 = xlApp.Cells( Zeile, 4).Value
    doc.Ko_2 = xlApp.Cells( Zeile, 5).Value
    doc.Ge_2 = xlApp.Cells( Zeile, 6).Value
    doc.Ko_3 = xlApp.Cells( Zeile, 7).Value
    doc.Ge_3 = xlApp.Cells( Zeile, 8).Value
    doc.Ko_4 = xlApp.Cells( Zeile, 9).Value
    doc.Ge_4 = xlApp.Cells( Zeile, 10).Value
    doc.Save True, True, True
    Next

    End Sub

    hey leute,


    hab ihr eine adresse bzw. link wo man die funktion "verbindung lotus notes und db2" nachlesen kann?


    würde mich mal gern in das thema reinarbeiten.


    dank euch

    Hallo Leute,


    ich habe ein feld in einem dokument, in dem der inhalt ein string ist. sieht so aus:


    "test1; text2; text3;....." ich wollte jetzt den eintrag mit einem agent und split trennen.


    ist das möglich?


    würde das auch mit formelsprache @explode gehen?


    der agent sollte dann alle dokumente in der view durchlaufen.


    dank euch

    Hey Leute ich hab jetzt folgenden Agent laufen:


    Sub Initialize

    Dim ws As New NotesUIWorkspace
    Set uidb = ws.CurrentDatabase
    Set db=uidb.Database
    Set coll = db.UnprocessedDocuments

    If coll.Count < 1 Then
    Messagebox "Hierfür muss genau ein Dokument markiert sein!"
    Exit Sub
    Else
    Set doc = coll.GetFirstDocument
    End If

    strValue = Inputbox$ ( "Bitte eingeben:" , "Neuer Produktname" , "")
    strValue1 = "; "

    Set doc = coll.getfirstDocument

    If strValue = "" Then
    Messagebox "Bitte neuen Produktnamen eintragen!"
    Exit Sub
    Else
    Do Until doc Is Nothing
    doc.product = doc.product(0) + strValue1 + strValue
    doc.bemerkung = doc.bemerkung(0) + strValue1 + strValue
    Call doc.save(True,True)

    Set doc=coll.getnextdocument(doc)
    Loop
    End If
    End Sub






    wenn jetzt in dem feld product folgender eintrag enthalten ist:


    test1; test2; test3


    dann werden test2; test3 überschrieben wenn ich einen neuen Namen über die obige funktion hinzufüge.


    wie kann ich das unterbinden?


    dank euch

    muss leider nochmal stören. wenn in dem feld product folgender eintrag enthalten ist:


    test1; test2; test3


    dann werden test2; test3 gelöscht wenn ich einen neuen über die obige funktion hinzufüge.


    wie kann ich das unterbinden?