Macro to add text to the body of an email

DJMorgan

New Member
Joined
Jan 16, 2018
Messages
3
Hi Folks

The amount I know about writing macros could probably be written on the back of a postage stamp so please bear with me Everything I've ever created has been copied from various websites and through a process of substation, trial and error I've eventually got it working.

I've got the below which works fine, but i want to add text into the body of the email. I can insert an "introduction" but it doesn't really display how I would like. In another similar
macro, I use
.item.display instead of .item.send so I can edit the body text before I send it.
I've tried .body, item.body, .htmlbody and can't get anything to work. Out of interest I also wonder why my code has .item.To, .item.CC etc when most of the other code I see just has .to, .cc etc. I'm thinking this is how the email is being created and linked to my original problem?

As a second and much less important note, I would like to add my signature to the email. Is there a quick and easy way of doing this?

Many thanks in advance
Dave



Private Sub CommandButton1_Click()

YesNo = MsgBox("Do you really want to email Mick and the CM's?", vbYesNo)

Select Case YesNo

Case vbYes
ActiveSheet.Range("B2:U37").Select

ActiveWorkbook.EnvelopeVisible = True

With ActiveSheet.MailEnvelope
.Item.To = "myemail"
.Item.CC = "myemail"
.Item.Subject = "daily sales inc P&D's"
.Item.Send
End With

Case vbNo

End Select

End Sub
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top