Code: Select all
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Set OutApp = CreateObject("Outlook.Application") 'This is where it hangs the second time the code is run. Email does go out the first time.
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = "MyEmailAddress@gmail.com"
.CC = ""
.BCC = ""
.Subject = "This is the Text Subject line"
.Body = "Hi there...text only"
.Send
End With
Set OutMail = Nothing
Set OutApp = Nothing