ScatmanKyle
Board Regular
- Joined
- Oct 26, 2015
- Messages
- 65
- Office Version
- 365
- Platform
- Windows
Hello!
I'm currently testing around with sending e-mails through a VBA procedure in Excel. I'm having one minor inconvenience and one actual issue.
The minor issue is the options such as the ".to", ".subject" etc aren't popping up in a preview window or automatically capitalizing when moving lines, so I don't know what options are available or if I'm entering the correct code.
The major issue is I can't send the e-mail. With the below code, I was able to add .Display and confirm that an e-mail with the correct information is drafted, but I can't figure out how to send it. I've seen a .Send command on guides, but it's not working for me.
I'm currently testing around with sending e-mails through a VBA procedure in Excel. I'm having one minor inconvenience and one actual issue.
The minor issue is the options such as the ".to", ".subject" etc aren't popping up in a preview window or automatically capitalizing when moving lines, so I don't know what options are available or if I'm entering the correct code.
The major issue is I can't send the e-mail. With the below code, I was able to add .Display and confirm that an e-mail with the correct information is drafted, but I can't figure out how to send it. I've seen a .Send command on guides, but it's not working for me.
VBA Code:
Sub Email_Send()
Dim outlookApp As Object
Dim mail As Object
Set outlookApp = CreateObject("Outlook.Application")
Set mail = outlookApp.createitem(0)
With mail
.To = "myemail@email.com"
.Subject = "Test"
.Body = "This is a test"
.Send
End With
End Sub