Copy All Visible(Formatted Text) from Excel to Outlook using VBA?
Please find below code to send email through outlook. However, I want to send the email with a selection that I have copied below using code. I do not wish to create a Table as HTML but instead just copy all visible?
Sub EmailRep()
Dim Mailbody As Range
Application.DisplayAlerts = False
Dim Outlook As Outlook.Application
Set Outlook = CreateObject("Outlook.Application")
Dim outmail As MailItem
Set outmail = Outlook.CreateItem(0)
Set Mailbody = ActiveWorkbook.Worksheets("Dashboard").Range("A1:F30")
Mailbody.Copy
With outmail
.To = "[email protected]"
.Subject = "All Open"
.Body = "This is Test Email"
.Display
.Send
End With
Set Outlook = Nothing
Set outmail = Nothing
Set Mailbody = Nothing
End Sub