jmcconnell
New Member
- Joined
- Feb 2, 2019
- Messages
- 35
Hi,
Looking to have a button within a spreadsheet that creates an email using outlook. Rather than just saying "Hello", I'd like it to say good morning up until 12:00, good afternoon until 17:00 and good evening. I'd also like to insert a signature at the bottom. Here's what I have so far:
Any help is much appreciated.
Thanks in advance,
James.
Looking to have a button within a spreadsheet that creates an email using outlook. Rather than just saying "Hello", I'd like it to say good morning up until 12:00, good afternoon until 17:00 and good evening. I'd also like to insert a signature at the bottom. Here's what I have so far:
Rich (BB code):
Private Sub Beenageeha_Click()
Dim xOutApp As Object
Dim xOutMail As Object
Dim xMailBody As String
On Error Resume Next
Set xOutApp = CreateObject("Outlook.Application")
Set xOutMail = xOutApp.CreateItem(0)
xMailBody = "Hi," & vbNewLine & vbNewLine & _
"Please see the fault below:" & vbNewLine & vbNewLine & _
"Kind regards,"
On Error Resume Next
With xOutMail
.To = ""
.CC = "insertemail@email.com; insertemail@email.com"
.BCC = ""
.Subject = "Beenageeha fault"
.Body = xMailBody
.Display
End With
On Error GoTo 0
Set xOutMail = Nothing
Set xOutApp = Nothing
End Sub
Thanks in advance,
James.
Last edited by a moderator: