Ich hoffe jemand kann mir bei folgendem Problem helfen...
Durch ein Excel-Makro soll ein E-mail via Outlook versendet werden.
Im Body des E-Mails sollen die Zellinhalte inklusive Formatierung übernommen werden.
Wie kann die Formatierung aus Excel ins Outlook übernommen werden?
Wenn also eine Excel-Zelle fett ist, dann soll dieser Wert auch im E-Mail fett eingetragen werden.
Leider konnte ich im Forum keine Lösung für oben genanntes Problem finden.
Vielen Dank im Voraus!
LG
Harald
Hier noch das Makro (vereinfacht dargestellt):
Sub Email_test()
Dim OutApp As Object
Dim OutMail As Object
Dim cell As Range
Dim OutlookOpened As Boolean
OutlookOpened = False
On Error Resume Next
Set OutApp = GetObject(, "Outlook.Application")
If OutApp Is Nothing Then
Set OutApp = CreateObject("Outlook.Application")
OutlookOpened = True
End If
On Error GoTo 0
For Each cell In Columns("B").Cells.SpecialCells(xlCellTypeConstants)
If cell.Value Like "?*@?*.?*" Then
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = Cells(cell.Row, "B").Value
.Subject = "Bla Bla Bla"
.htmlbody = "Sehr geehrte Damen und Herren," & "" & _
"Ihr Ergebnis lautet " & Cells(cell.Row, "A").Value & "
"
.display
End With
On Error GoTo 0
Set OutMail = Nothing
End If
Next cell
If OutlookOpened Then OutApp.Quit
Set OutApp = Nothing
End Sub