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

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
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,215,769
Messages
6,126,787
Members
449,336
Latest member
p17tootie

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