Beiträge von sperri1

    Hey Leute,


    wünsch euch erstmal en frohes neues jahr.


    hab folgendes problem. ich habe in einer datenbank mehrere dokumente. die alle haben ein feld "product".
    jetzt soll in das feld "product" ein neuer, zusetzlicher name eingefügt werden. das soll aber nur bei den dokumenten passieren, die ausgewählt wurden in der viel "all".


    ich hab mal mit der funktion fieldappendtext rumgespielt, nur leider fehlt mir ein ansatz.


    gibt es ein möglichkeit über einen button in der view,der z.B. eine Textbox öffnet?


    in der textbox wird dann der neue name eingetragen und dann in das feld "product" der markieren dokumente hinzugefügt?


    habt ihr ne idee?


    dank euch

    Hallo Leute,


    mein Mailfach lässt sich nicht öffnen, wenn ich auf das Mailfach klicke öffnet es kurz und zeigt den Fehler "Object variable not set", dann schließt es sich wieder.


    Hab mal mit den Debugger reingeschaut. Er zeigt mir den Fehler in der Script-Bibliothek --> CoreEmailClasses --> Declarations -->
    Call m_uiws.EditDocument(False,RedirNote)


    Hab leider keine Ahnung was das sein könnte.


    Könnt ihr mir da helfen?

    danke jungs für die vielen tollen tips!!


    ich hab das jetzt kurzfristig erstmal so gelöst, dass ich für die 10 Produkte jeweils eine eigene View erstellt hab und ich die dann komplett auslese.


    ich schau mir jetzt mal euere vorschläge an.


    dank euch schonmal

    taurec dank dir schonmal für deine hilfe, weiß nur grad nicht so richtig wie ich das in angriff nehmen kann.
    wie mach ich den die abfrage in der schleife? müsste doch dann eine variable weitergeben oder?

    code sieht so aus:
    rot ist die zeile mit dem fehler!


    Sub Initialize
    Dim xlApp As Variant
    Dim xlSheet As Variant
    Dim Session As New NotesSession
    Dim collection As NotesDocumentCollection
    Dim View As NotesView
    Dim doc As NotesDocument
    Dim db As NotesDatabase

    Dim xlCells As Variant ' Excel-Zelle
    Dim SpalteTitel As String
    Dim iSpalte, iZeile, iSpalteCount As Integer



    Set db = session.CurrentDatabase
    Set xlApp = CreateObject("Excel.application")

    xlApp.StatusBar = "WorkSheet wird erstellt. Bitte warten..."
    xlApp.Visible = True
    xlApp.Workbooks.Add
    xlApp.ReferenceStyle = 2

    Set xlCells = xlApp.ActiveWorkbook.ActiveSheet.Cells ' Excel-Zelle

    Set xlSheet = xlApp.Workbooks(1).Worksheets(1)
    xlsheet.Name = "Excel Druckvorlage"

    ' Ueberschriften

    With xlSheet
    .range("A1").Value = "Produkt"
    .range("B1").Value = "AFO"
    .range("C1").Value = "Beschreibung"
    .range("D1").Value = "Tool"
    .range("E1").Value = "Rezept"
    .range("F1").Value = "Name"
    .range("G1").Value = "Datum"

    End With

    ' Formatierung

    With xlapp
    .Columns("A:G").select
    .Rows("1:1").select
    .Selection.font.bold=True
    .Columns("A:A").Select
    .Selection.ColumnWidth = 30
    .Columns("B:B").Select
    .Selection.ColumnWidth = 25
    .Columns("C:C").Select
    .Selection.ColumnWidth = 50
    .Columns("D:D").Select
    .Selection.ColumnWidth = 25
    .Columns("E:E").Select
    .Selection.ColumnWidth = 25
    .Columns("F:F").Select
    .Selection.ColumnWidth = 20
    .Columns("G:G").Select
    .Selection.ColumnWidth = 20
    .Range("A1:G1").Select
    .Range("A1:G1").Activate
    .Selection.Borders(5).LineStyle = -4142
    .Selection.Borders(6).LineStyle = -4142
    .Selection.Borders(7).LineStyle = -4142
    .Selection.Borders(8).LineStyle = -4142
    .Selection.Borders(9).LineStyle = 1
    .Selection.Borders(9).Weight = -4138
    .Selection.Borders(9).ColorIndex = -4105
    .Selection.Borders(10).LineStyle = -4142
    .Selection.Borders(12).LineStyle = -4142
    End With

    iSpalte = 0
    iZeile = 1



    Set View = Session.CurrentDatabase.GetView("export")
    Set collection = db.UnprocessedDocuments

    ' Spaltentitel exportieren
    Forall c In view.Columns
    iSpalte = iSpalte + 1
    SpalteTitel = c.title
    If SpalteTitel = "" Then
    SpalteTitel = "Spalte " + Cstr(iSpalte)
    End If
    xlCells( iZeile, iSpalte).Value = SpalteTitel
    End Forall

    ' Ansichtseinträge exportieren
    iSpalteCount = iSpalte
    Set doc = collection.GetFirstDocument
    While Not doc Is Nothing
    iZeile = iZeile + 1
    For iSpalte = 1 To iSpalteCount
    [color=FF0000]xlCells(iZeile, iSpalte).Value = doc.ColumnValues(iSpalte - 1)[/color]
    Next
    Set doc = collection.GetNextDocument(doc)
    Wend
    End Sub

    Hab mein Script mal en bissel angepasst. Der funktioniert ohne Probleme. Ich bekomm die View "export" exportiert so wie sie auch in Notes steht.


    Nur leider bekomm ich alle Dokumente exportiert. Ich möchte aber nur die ausgewählten haben.


    Hab es mal mit "Set collection = db.UnprocessedDocuments" probiert und die "Set doc = view.GetFirstDocument" in Set doc = collection.GetFirstDocument" geändert aber bin da leider in eine Fehlermeldung (Variant does not contain a container) gelaufen.


    Habt ihr eine Idee was das sein könnte?


    danke





    Sub Initialize
    Dim xlApp As Variant
    Dim xlSheet As Variant
    Dim Session As New NotesSession
    Dim collection As NotesDocumentCollection
    Dim View As NotesView
    Dim doc As NotesDocument
    Dim db As NotesDatabase

    Dim xlCells As Variant ' Excel-Zelle
    Dim SpalteTitel As String
    Dim iSpalte, iZeile, iSpalteCount As Integer



    Set db = session.CurrentDatabase
    Set xlApp = CreateObject("Excel.application")

    xlApp.StatusBar = "WorkSheet wird erstellt. Bitte warten..."
    xlApp.Visible = True
    xlApp.Workbooks.Add
    xlApp.ReferenceStyle = 2

    Set xlCells = xlApp.ActiveWorkbook.ActiveSheet.Cells ' Excel-Zelle

    Set xlSheet = xlApp.Workbooks(1).Worksheets(1)
    xlsheet.Name = "Excel Druckvorlage"

    ' Ueberschriften

    With xlSheet
    .range("A1").Value = "Produkt"
    .range("B1").Value = "AFO"
    .range("C1").Value = "Beschreibung"
    .range("D1").Value = "Tool"
    .range("E1").Value = "Rezept"
    .range("F1").Value = "Name"
    .range("G1").Value = "Datum"

    End With

    ' Formatierung

    With xlapp
    .Columns("A:G").select
    .Rows("1:1").select
    .Selection.font.bold=True
    .Columns("A:A").Select
    .Selection.ColumnWidth = 30
    .Columns("B:B").Select
    .Selection.ColumnWidth = 25
    .Columns("C:C").Select
    .Selection.ColumnWidth = 50
    .Columns("D:D").Select
    .Selection.ColumnWidth = 25
    .Columns("E:E").Select
    .Selection.ColumnWidth = 25
    .Columns("F:F").Select
    .Selection.ColumnWidth = 20
    .Columns("G:G").Select
    .Selection.ColumnWidth = 20
    .Range("A1:G1").Select
    .Range("A1:G1").Activate
    .Selection.Borders(5).LineStyle = -4142
    .Selection.Borders(6).LineStyle = -4142
    .Selection.Borders(7).LineStyle = -4142
    .Selection.Borders(8).LineStyle = -4142
    .Selection.Borders(9).LineStyle = 1
    .Selection.Borders(9).Weight = -4138
    .Selection.Borders(9).ColorIndex = -4105
    .Selection.Borders(10).LineStyle = -4142
    .Selection.Borders(12).LineStyle = -4142
    End With

    iSpalte = 0
    iZeile = 1



    Set View = Session.CurrentDatabase.GetView("export")
    Set collection = db.UnprocessedDocuments

    ' titel exportieren
    Forall c In view.Columns
    iSpalte = iSpalte + 1
    SpalteTitel = c.title
    If SpalteTitel = "" Then
    SpalteTitel = "Spalte " + Cstr(iSpalte)
    End If
    xlCells( iZeile, iSpalte).Value = SpalteTitel
    End Forall

    ' einträge exportieren
    iSpalteCount = iSpalte
    Set doc = view.GetFirstDocument
    While Not doc Is Nothing
    iZeile = iZeile + 1
    For iSpalte = 1 To iSpalteCount
    xlCells(iZeile, iSpalte).Value = doc.ColumnValues(iSpalte - 1)
    Next
    Set doc = view.GetNextDocument(doc)
    Wend
    End Sub

    dank dir das hat jetzt soweit funktioniert.
    hab jetzt nur noch ein kleines problem.


    der export wird über einen button ausgelöst. der user sucht sich die dokumente in der view aus, die er exportieren möchte und betätigt den button.


    ich hab jetzt festgestellt, das der script in der 3. excelzeile alle dokumente durchläuft die der user ausgewählt hat.
    es werden dann nur die dokumente, wo in dem AFO-Feld Mehrfacheingaben enthalten sind zeilenversetzt auflistet.


    könnte das ein problem mit der FOR-Schleife sein?


    gruß christian

    he dirk ich dank dir schonmal für deine hilfe.


    ich steh gerade auf der leitung:-) wie bastel ich denn die For-Schleife richtig in den code rein?


    hab den join rausgenommen und die For-Schleife dann davor gesetzt. aber das passt noch nicht richtig.


    kannst du mir da weiterhelfen?


    Dank dir




    While Not (Doc Is Nothing)
    With xlSheet
    .range("A" + Cstr(i + 2)).Value = Join(doc.Product,", ")


    temp_strg = ""
    trenner = "; "
    For i = 0 To Ubound(doc.AFO)
    If temp_strg = "" Then
    temp_strg = Cstr(doc.AFO(i))
    Else
    temp_strg = temp_strg & trenner & doc.AFO(i)
    End If
    Next

    .range("B" + Cstr(i + 2)).Value = doc.AFO(0)

    .range("C" + Cstr(i + 2)).Value = doc.Beschreibung(0)

    Da bekomm ich leider noch den gleichen Fehler. In dem Feld AFO stehen Zahlenwerte drin.
    Wenn 2 Zahlenwerte drin stehen, also Bsp: (5670 , 1234) läuft der Agent ohne Problem.


    Steht nur ein Zahlenwert drin, also Bsp: (1234) bricht er mit einem "Type mismatch" ab.

    Hallo Leute,


    ich habe einen Agent der mir eine Ansicht in Excel exportiert.
    Das funktioniert auch soweit bis auf das Feld "AFO". Da ist es möglich Mehrfacheingaben zu machen. Ich hab versucht diese über die Join Funktion darzustellen. Da es aber ein Zahlenfeld ist funktioniert dies wahrscheinlich nicht.


    Könnt ihr mir dabei helfen?


    Vielen Dank


    Code:
    Sub Initialize
    Dim xlApp As Variant
    Dim xlSheet As Variant
    Dim Session As New NotesSession
    Dim collection As NotesDocumentCollection
    Dim View As NotesView
    Dim doc As NotesDocument
    Dim db As NotesDatabase

    Set db = session.CurrentDatabase
    Set xlApp = CreateObject("Excel.application")

    xlApp.StatusBar = "WorkSheet wird erstellt. Bitte warten..."
    xlApp.Visible = True
    xlApp.Workbooks.Add
    xlApp.ReferenceStyle = 2

    Set xlSheet = xlApp.Workbooks(1).Worksheets(1)
    xlsheet.Name = "Excel Druckvorlage"

    ' Ueberschriften

    With xlSheet
    .range("A1").Value = "Produkt"
    .range("B1").Value = "AFO"
    .range("C1").Value = "Beschreibung"
    .range("D1").Value = "Tool"
    .range("E1").Value = "Rezept"
    .range("F1").Value = "Name"
    .range("G1").Value = "Datum"

    End With

    ' Formatierung

    With xlapp
    .Columns("A:G").select
    .Rows("1:1").select
    .Selection.font.bold=True
    .Columns("A:A").Select
    .Selection.ColumnWidth = 30
    .Columns("B:B").Select
    .Selection.ColumnWidth = 25
    .Columns("C:C").Select
    .Selection.ColumnWidth = 50
    .Columns("D:D").Select
    .Selection.ColumnWidth = 25
    .Columns("E:E").Select
    .Selection.ColumnWidth = 25
    .Columns("F:F").Select
    .Selection.ColumnWidth = 20
    .Columns("G:G").Select
    .Selection.ColumnWidth = 20
    .Range("A1:G1").Select
    .Range("A1:G1").Activate
    .Selection.Borders(5).LineStyle = -4142
    .Selection.Borders(6).LineStyle = -4142
    .Selection.Borders(7).LineStyle = -4142
    .Selection.Borders(8).LineStyle = -4142
    .Selection.Borders(9).LineStyle = 1
    .Selection.Borders(9).Weight = -4138
    .Selection.Borders(9).ColorIndex = -4105
    .Selection.Borders(10).LineStyle = -4142
    .Selection.Borders(12).LineStyle = -4142
    End With


    Set View = Session.CurrentDatabase.GetView("all")
    Set collection = db.UnprocessedDocuments
    Set Doc = collection.GetFirstDocument
    i = 0
    While Not (Doc Is Nothing)
    With xlSheet
    .range("A" + Cstr(i + 2)).Value = Join(doc.Product,", ")
    [color=CC3300].range("B" + Cstr(i + 2)).Value = Join(doc.AFO,", ")[/color]
    .range("C" + Cstr(i + 2)).Value = doc.Beschreibung(0)
    .range("D" + Cstr(i + 2)).Value = doc.Tool(0)
    .range("E" + Cstr(i + 2)).Value = doc.Rezept(0)


    End With
    i = i + 1
    Set doc = collection.GetNextDocument(doc)
    Wend
    End Sub