Ich möchte gerne die Excel-Zwischenablage per VBA in das Outlook Textfeld einfügen und versenden.
Hat mir jemand einen Codeansatz?
Besten Dank für einen Tip
Gruss
TOM
Sub Excel_Serienmail_via_Outlook_Senden()
Dim OutApp As Object, Mail As Object
Dim i As Integer, rngBereich As Range
Dim Nachricht
Set OutApp = CreateObject("Outlook.Application")
Set Nachricht = OutApp.CreateItem(0)
Set rngBereich = Range("A4:H5")
rngBereich.Copy
With Nachricht
.To = Cells(2, 1) 'Adresse
.Subject = Cells(2, 3) 'Betreffzeile
.Body = rngBereich.PasteSpecial(xlAll)
'Cells(2, 4) & vbCr & vbCr & strBereich _
'& vbCr & vbCr & Cells(2, 5) 'Sendetext
.Display
SendKeys "%s", True
'.Send
End With
'Variablen zurücksetzen sonst geht es nicht
Set OutApp = Nothing 'CreateObject("Outlook.Application")
Set Nachricht = Nothing 'OutApp.CreateItem(0)
End Sub
Sub Excel_Serienmail_via_Outlook_Senden()
Dim OutApp As Object, Mail As Object
Dim i As Integer, rngBereich As Range
Dim Nachricht
Set OutApp = CreateObject("Outlook.Application")
Set Nachricht = OutApp.CreateItem(0)
Set rngBereich = Range("A4:H5")
rngBereich.Copy
With Nachricht
.To = Cells(2, 1) 'Adresse
.Subject = Cells(2, 3) 'Betreffzeile
.Body = rngBereich.PasteSpecial(xlAll)
'Cells(2, 4) & vbCr & vbCr & strBereich _
'& vbCr & vbCr & Cells(2, 5) 'Sendetext
.Display
SendKeys "%s", True
'.Send
End With
'Variablen zurücksetzen sonst geht es nicht
Set OutApp = Nothing 'CreateObject("Outlook.Application")
Set Nachricht = Nothing 'OutApp.CreateItem(0)
End Sub