Creating a serial e-mail with VBA in Microsoft Excel

In einem Excel-Tabellenblatt sind Name, Vorname und E-Mail- Adresse einer Reihe von Personen gespeichert. Mit Hilfe einer Schleife wird eine String zusammengesetzt, die aus allen E-Mail-Adressen des Tabellenblatts besteht. Die Adressen werden durch Semikolons voneinander getrennt. Das letzte Semikolon wird mit den Funktionen Left() und Len() wieder abgeschnitten.

The email is created as in the previous example. It gets the properties To, Bcc and Subject. The previously composed character string is assigned to the Bcc property. The e-mail is sent with the Send () method.

Sub SerienEMail()
Dim appOutlook As Outlook.Application
Dim MailItem As Outlook.MailItem
Dim i As Integer
Dim Bcc As String
' Liste der Empfänger aus Tabellenblatt zusammensetzen
ThisWorkbook.Worksheets("Tabelle3").Activate
i=1
Do While Cells(i, 3) <> ""
Bcc = Bcc & Cells(i, 3).Value & ";"
i=i+1
Loop
Bcc = Left(Bcc, Len(Bcc) – 1)
' Anwendung Outlook starten, E-Mail erstellen
Set appOutlook = CreateObject("Outlook.Application")
Set MailItem = appOutlook.CreateItem(olMailItem)
' Eigenschaften hinzufügen und senden
MailItem.To = "[email protected]"
MailItem.Bcc = Bcc
MailItem.Subject = "Grillparty um 17:00 Uhr"
MailItem.Send
appOutlook.Quit
End Sub


Was the explanation to "Creating a serial e-mail with VBA in Microsoft Excel"Helpful? Rate now:

More explanations too