E-Mail Signature in VBA Code einbinden.
27.02.2023 08:48:14
Boris.S.
ich habe versucht in einen VBA Code für eine Automatische E-Mail die Signature mit einzufügen. Leider bekomme ich es nicht hin. Könnt ihr mir helfen?
Private Sub CommandButton1_Click()
'Updated by Extendoffice 2017/9/14
Dim xOutApp As Object
Dim xOutMail As Object
Dim xMailBody As String
On Error Resume Next
Set xOutApp = CreateObject("Outlook.Application")
Set xOutMail = xOutApp.CreateItem(0)
xMailBody = "Hallo Jonas" & vbNewLine & vbNewLine & _
"In der Datei A-Factory-Contura-Vitra Complaints.xlsm habe ich einen neuen Eintrag gemacht. " & vbNewLine & _
"Datei" & vbNewLine & vbNewLine & _
"Grüße Boris"
On Error Resume Next
With xOutMail
.To = "E-Mail Adresse"
.CC = ""
.BCC = ""
.Subject = "Neuer Eintrag in Datei: A-Factory-Contura-Vitra Complaints.xlsm"
.Body = xMailBody
.Display 'or use .Send
End With
On Error GoTo 0
Set xOutMail = Nothing
Set xOutApp = Nothing
End Sub
Danke euch.
Grüße Boris