Hallo Leute ich hab doch noch was gefunden mit attachment-function Sub NotesMail()
Dim strEmpfaenger, strBetreff, strText, strcc, strbcc As String
Dim strFile As String
strEmpfaenger = "mail@mail.com"
strBetreff = "Versandinfo"
strText = "Test"
strText = "Bitte beachten Sie ..."
strFile = "D:\Test\test.doc" 'ActiveDocument.FullName
NotesMailSend strEmpfaenger, strBetreff, strText, strcc, _
strbcc, strFile
End Sub
Function NotesMailSend(strEmpfaenger As Variant, strBetreff As Variant, _
strText As Variant, strcc As Variant, strbcc As Variant, strFilename As String)
' Dimensionierung der Objektvariablen
Dim objNotes As Object, objNotesDB As Object, objNotesMailDoc As Object
Dim SendItem, NCopyItem, BlindCopyToItem, i As Integer, rtitem
Dim msg As String
'
' Zuweisung der Objektvariablen
'On Error GoTo ExitF
Set objNotes = GetObject("", "Notes.Notessession")
Set objNotesDB = objNotes.GETDATABASE("", "")
' Öffnen der Standard-Maildatenbank / Erstellen neues Maildokument
Call objNotesDB.OPENMAIL
Set objNotesMailDoc = objNotesDB.CreateDocument
objNotesMailDoc.form = "Memo"
Call objNotesMailDoc.Save(True, False)
Set SendItem = objNotesMailDoc.APPENDITEMVALUE("SendTo", "")
Set NCopyItem = objNotesMailDoc.APPENDITEMVALUE("CopyTo", "")
Set BlindCopyToItem = objNotesMailDoc.APPENDITEMVALUE("BlindCopyTo", "")
objNotesMailDoc.SendTo = strEmpfaenger
objNotesMailDoc.Subject = strBetreff
Set rtitem = objNotesMailDoc.CREATERICHTEXTITEM("Body")
objNotesMailDoc.Body = strText
rtitem.ADDNEWLINE (1)
Call rtitem.EMBEDOBJECT(1454, "", strFilename)
' Mail zustellen
Call objNotesMailDoc.Save(True, False)
Call objNotesMailDoc.send(False)
objNotesMailDoc.RemoveItem ("DeliveredDate")
Call objNotesMailDoc.Save(True, False)
' Nachricht an Benutzer
msg = "Die E-Mail wurde erfolgreich versendet!"
MsgBox msg, vbInformation, "Notesmail versenden..."
' Objektvariablen zurücksetzenCall
objNotes.Close
objNotes.Quit
Set objNotes = Nothing
ExitF:
End Function
grüsse