Live-Forum - Die aktuellen Beiträge
Anzeige
Archiv - Navigation
1760to1764
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Inhaltsverzeichnis

EMail versenden Lotus Notes

EMail versenden Lotus Notes
27.05.2020 10:01:31
ZS
Hallo zusammen,
ich hoffe, dass mir hier jemand weiterhelfen kann.
Ich habe ein Tabellenblatt das wie folgt aufgebaut ist:
x mappe1@gmx.de ‪C:\Users\zieglerj\Desktop\Mappe1.pdf Mappe 1
x mappe2@gmx.de ‪C:\Users\zieglerj\Desktop\Mappe2.pdf Mappe 2
Spalte A = aktiv
Spalte B = EmailAdresse
Spalte C = Pfad
Spalte D = Vorname
Spalte C = Nachname
Ich würde jetzt gerne per Lotus Notes eine E-MAil pro Adresse mit dem jeweiligen Anhang, welche auf dem Pfad liegt senden.
Den E-Mail-Versand bekomm ich hin, nur nimmt es mir die Anhänge nicht.
Kann mir jemand helfen?
****
Hier ist mein Code
Sub E_Mails_versenden()
Sheets("Tabelle3").Activate
Cells(2, 1).Select
Dim i As Integer
For i = 2 To 10
If Cells(i, 1).Value = "x" Then
Dim Maildb As Object
Dim MailDoc As Object
Dim Body As Object
Dim Session As Object
Dim Recip As String
Dim Attachment1 As String
Recip = Cells(i, 2).Value
Attachment1 = "‪C:\Users\zieglerj\Desktop\" & "_" & Cells(i, 4).Value & "_KW " &  _
Cells(i, 5).Value & ".pdf "
'Start a session of Lotus Notes
Set Session = CreateObject("Lotus.NotesSession")
'This line prompts for password of current ID noted in Notes.INI
Call Session.Initialize
'or use below to provide password of the current ID (to avoid Password prompt)
'Call Session.Initialize("")
'Open the Mail Database of your Lotus Notes
Set Maildb = Session.GETDATABASE("", "names.nsf")
If Not Maildb.IsOpen = True Then Call Maildb.Open
'Create the Mail Document
Set MailDoc = Maildb.createdocument
Call MailDoc.Replaceitemvalue("Form", "Memo")
'Set the Recipient of the mail
Call MailDoc.Replaceitemvalue("SendTo", Recip)
'Set subject of the mail
Call MailDoc.Replaceitemvalue("Subject", "Sales Cockpit")
'Create and set the Body content of the mail
Set Body = MailDoc.CreateRichTextItem("Body")
Call Body.APPENDTEXT("Anbei erhalten Sie ihr persönliches Sales Cockpit für die letzte KW")
'Example to create an attachment (optional)
If Attachment  "" Then
Set AttachME = Attachment1
Set EmbedObj = AttachME.EmbedObject(1454, "", Attachment1, "Attachment")
End If
'Send the document
'Gets the mail to appear in the Sent items folder
Call MailDoc.Replaceitemvalue("PostedDate", Now())
Call MailDoc.SEND(False)
'Clean Up the Object variables - Recover memory
Set Maildb = Nothing
Set MailDoc = Nothing
Set Body = Nothing
Set Session = Nothing
Else
MsgBox "The Mail have been sent."
End If
Next
End Sub

*****************

1
Beitrag zum Forumthread
Beitrag zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: EMail versenden Lotus Notes
27.05.2020 10:37:54
ede
Hallo ZS,
auf den ersten Blick ist deine IF-Abfrage falsch:
If Attachment1 "" Then
Gruss
ede
Anzeige

132 Forumthreads zu ähnlichen Themen

Anzeige
Anzeige
Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige