Sending an email using outlook

PaulCowie

New Member
Joined
Sep 4, 2016
Messages
3
I am wanting to send an email from outlook. It is all user input.
The email address can be found on sheet 1 cell D17 and the user entered message in cell H5.


Can anyone help?
If i havn't been clear please get in touch
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
I forgot to mention that i want it all done through a command button so that the command button automatically sending the email to the email address in cell D17 and takes the text from Cell H5 as the body
 
Upvote 0
PaulCowie,

In the MrExcel opening/banner page (top right), click on Advanced Search

In the Keyword(s): box

Enter the following with the " characters:

"email" + "Outlook"

And, click on Search Now
 
Upvote 0
I'm slowly getting there.
This is my current code which kinda works



Private Sub CommandButton13_Click()
Dim rng As Range
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String


With Application
.EnableEvents = False
.ScreenUpdating = False
End With


Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)


strbody = "<.H3><.B>Ahoj," & _
"Níže posílám seznam objednávek.<.br>" & _
"PS:speciální objednávky mají odlišné PO, od zaslaných, je nutné kontaktovat sklad<.br>" & _
"<.br><.br><.B>Dekujeme" & _
"<.br><.br><.B>Sklad"


On Error Resume Next
EndDate = Range("H" & ActiveCell.Row).Value
With OutMail
.To = [D17].Value
.CC = ""
.BCC = ""
.Subject = ""
.body = EndDate
.Send
End With
On Error GoTo 0


With Application
.EnableEvents = True
.ScreenUpdating = True
End With


Set OutMail = Nothing
Set OutApp = Nothing
End Sub


The only bit i want to change is in red above or

EndDate = Range("H" & ActiveCell.Row).Value

I want it to be a specific cell, in this example H6 instead of active cell.row

Tried experimenting with this and not been able to get it to work for a specific cell. Can anyone help?
 
Upvote 0
Use

Code:
EndDate = Range("H6").Value

Instead of

Code:
EndDate = Range("H" & ActiveCell.Row).Value
 
Upvote 0

Forum statistics

Threads
1,217,121
Messages
6,134,755
Members
449,888
Latest member
webarnes99

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