Domino 9 und frühere Versionen > ND7: Administration & Userprobleme

Automatisch aus Excel heraus Dokumente in LN-DB erstellen

<< < (4/4)

marschul:
Gibt es denn in der Maske ein RT-Feld namens "Attachment"? Wenn es nur ein "Body" gibt, solltest Du die Anhänge auch darin erstellen. Oder es gibt halt 2 Felder, oder....

Silki:
Hallo,

jetzt habe ich es endlich geschafft.

So sieht der Code jetzt aus und es funzt wunderprächtigst  ;)


--- Code: ---Sub Test()
Dim i As Integer
Dim Session As Object
Dim db As Object
Dim doc As Object

Dim AttachME As Object
Dim EmbedObj As Object
Dim strPfad As String

'Erstellt Dokumente in Lotus Notes DB aus den Angaben in Tabelle1 inkl. Anhänge
i = 1
    Do While Cells(i, 1).Value <> ""
        'Debug.Print Cells(i, 5)
            Set Session = CreateObject("Notes.Notessession")
            Set db = Session.GetDatabase("ZZ", "ZZ\test\MSystem.nsf") 'Server, Ordner
            Set doc = db.createdocument()
                doc.Form = "Document"                       'Dokumenttyp in Lotus Notes DB
                doc.DocumentAuthors = Cells(i, 4).Value     'Werte aus Spalte D
                doc.From = Cells(i, 3).Value                'Werte aus Spalte C
                doc.Subject = Cells(i, 1).Value             'Werte aus Spalte A
                doc.Categories = Cells(i, 2).Value          'Werte aus Spalte B
                    Set rtBody = doc.CREATERICHTEXTITEM("body")
                    strPfad = Cells(i, 5).Value             'Werte aus Spalte E
                    Call rtBody.EMBEDOBJECT(1454, "", strPfad)
                               
            Call doc.Save(True, True)
        i = i + 1
    Loop
MsgBox "FERTIG"
End Sub

--- Ende Code ---

Vielen, vielen Dank für eure Hilfe.

Gruß
Silke

Navigation

[0] Themen-Index

[*] Vorherige Sete

Zur normalen Ansicht wechseln