Bering
New Member
- Outlook version
- Outlook 2016 64 bit
- Email Account
- POP3
Hello everyone, I hope you can help me with this: I have a macro that allows to select an email and to forward it with the attachments and a new custom text pulled from an excel file. Everything works fine.
What I would like to achive is removing the original email, which normally remains appended when forwarding. Is there a way to delete it from the newly created email?
Apologies if this has been asked already, I could not find anything.
Thank you
What I would like to achive is removing the original email, which normally remains appended when forwarding. Is there a way to delete it from the newly created email?
Apologies if this has been asked already, I could not find anything.
Thank you
Code:
Option Explicit
Sub Email()
Dim myMail As Outlook.MailItem
Dim wb As Excel.Workbook 'Early bind - needs a reference to Excel
Dim myXL As Excel.Application 'Early bind - needs a reference to Excel
Dim myBody As String
Set myXL = GetObject(, "Excel.Application") 'Excel already running
Set wb = myXL.Workbooks("Reco Call_Distri_Reporting LOG 2.xlsm") '<-- Wb already open. Rename as appropriate
'Forward
Set myMail = ActiveExplorer.Selection.Item(1).Forward
With myMail
.Subject = Replace(myMail.Subject, "FW: ", "")
.Recipients.Add wb.ActiveSheet.Range("D6")
.CC = wb.ActiveSheet.Range("D7")
.Display
myBody = wb.ActiveSheet.Range("H9")
.HTMLBody = myBody & vbCrLf & myMail.HTMLBody
End With
Set myMail = Nothing
End Sub/CODE]