I am using the below code and it gives me runtime error 287 on the line signature = OutMail.HTMLBody.
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
With OutMail ' This creates a blank email and captures the users default signature.
.BodyFormat = olFormatHTML
.Display
signature = OutMail.HTMLBody
.To = " "
.CC = " "
.BCC = " "
.Subject = "Late Order Notification"
.HTMLBody = strFntNormal & strBodyText & strTableBody & "<br><br>" & signature
.Display 'or use .Send
.ReadReceiptRequested = False
End With
'outlook tidy up
Set OutMail = Nothing
Set OutApp = Nothing
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
With OutMail ' This creates a blank email and captures the users default signature.
.BodyFormat = olFormatHTML
.Display
signature = OutMail.HTMLBody
.To = " "
.CC = " "
.BCC = " "
.Subject = "Late Order Notification"
.HTMLBody = strFntNormal & strBodyText & strTableBody & "<br><br>" & signature
.Display 'or use .Send
.ReadReceiptRequested = False
End With
'outlook tidy up
Set OutMail = Nothing
Set OutApp = Nothing