Formattierung des E-Mailtextes
13.06.2023 16:39:40
Ronald
Hallo an alle!
Ich hab eine Frage zur Formattierung von Text innerhalb einer automatisch zu versendenden E-Mail.
Mein Quelltext sieht auszugsweise wie folgt aus:
Dim applOutlook As Outlook.Application
Dim nsOutlook As Outlook.Namespace
Dim oAccount As Account
Dim objMail As Object
Dim strAbsender As String
Dim strEmailAdresse As String
Dim strTmp As String
Dim strEmailName As String
Dim strEmailAdresse2 As String
Dim objClip As DataObject
strAbsender = "Test@test.de"
Set applOutlook = New Outlook.Application
Set nsOutlook = applOutlook.GetNamespace("MAPI")
Set objMail = applOutlook.CreateItem(0)
Set objClip = New DataObject
'Routine fürs E-Mail schicken
For Each oAccount In applOutlook.Session.Accounts
If oAccount = strEmailAdresse Then 'oAccount.DisplayName
'oAccount.SmtpAddress = strAbsender
With objMail
'.SendUsingAccount = "Test@test.de"
.To = frmService.txtEmail36.Text 'hier vorher abfragen, ob E-Mail-Adresse hinterlegt
.Subject = strServiceID
.Body = strEMailVorschau
If strEMailVorschauAttachm = "" Then
Else
.Attachments.Add strEMailVorschauAttachm
End If
.BCC = strBCC
.SentOnBehalfOfName = "Test@test.de"
'Set .SendUsingAccount = oAccount
.Send ' .Display = Erstellt die Email und öffnet diese. Der Versand erfolgt anschließend manuell vom User!
End With
End If
Next
Dieser Quelltext funktioniert. Das Einzige, was ich gerne wissen möchte: Wie kann ich hier formattierten Text innerhalb der
E-Mail verwenden. Wie zum Beispiel:
Name: - gewisse Anzahl Tabs als Abstand - Max Mustermann
Wohnort: - gewisse Anzahl Tabs als Abstand - Musterhausen
Und auch wäre es interessant, wie ich das mit diesen Tabs als Abstand am besten realisieren kann.
Vielen Dank im Voraus.
Gruß Ronald