I'm was using the code below to send Outlook 2010 emails form Access 2010. We recently upgraded to Office 2016 and now I get a runtime error 287 on line Signature = olMailItem.HTMLBody
Thanks
Private Sub DoEmail(Fname As String, Lname As String, Email As String, attach As String)
Dim olApp As New Outlook.Application
Dim olMailItem As Outlook.MailItem
Dim a As Variant
Dim Signature As String
Set olMailItem = olApp.CreateItem(0)
With olMailItem
.Display
End With
Signature = olMailItem.HTMLBody
olMailItem.To = Email
olMailItem.Subject = "Monthly Reports"
olMailItem.HTMLBody = "Find attached your Monthly Cognos and/or eCAPE Monthly Reports. If you have questions please let me know." & "</br></br></br>" & Signature
For Each a In Split(attach, ",")
If Dir(a) <> "" Then
olMailItem.Attachments.Add
a
End If
Next
olMailItem.Display
' olMailItem.Send
Set olMailItem = Nothing
Set olApp = Nothing
End Sub