Domino 9 und frühere Versionen > Entwicklung

VBA Script für senden an Notes

<< < (3/3)

markoii:
das mit der CLSID war das Problem habe Notes nochmal installiert und jetzt geht`s.

Super Danke euch für die tolle Hilfe ;D ;D ;D


möchte ja nicht lästig erscheinen aber wie sprech ich attachments an mit doc.attachment = hat es nicht geklappt naja ist auch nicht so schlimm bekomm ich schon irgendwie raus. ::) ::)

ata:
... such mal in der Notes-Designer-Hilfe unter NotesEmbeddedObject...

ata

markoii:
Hallo Leute ich hab doch noch was gefunden mit attachment-function :D :D

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

Navigation

[0] Themen-Index

[*] Vorherige Sete

Zur normalen Ansicht wechseln