I have the following code that sends me a mail when a certain activity has been completed in my macro:
Dim objOL As New Outlook.Application
Dim objMail As MailItem
Set objOL = New Outlook.Application
Set objMail = objOL.CreateItem(olMailItem)
With objMail
.To = "myemail"
'.Sender = "Report"
.Subject = "REPORT DONE- " & Format(Date, "dd-mmm-yyyy") & " - " & Format(Time, "hh:mm:ss")
'.Body = ""
'.Display
.Send
End With
Set objMail = Nothing
Set objOL = Nothing
One problem is that it errors when Outlook is not open, what code do I need to add to have the macro open Outlook if it's not already open?
Also, the basic mail it sends me is fine but was wondering if it's possible to open an existing mail that is set-up with a distribution list, subject and body, which includes a few tables and formatted text?
Bookmarks