christinawang
New Member
- Joined
- Feb 27, 2016
- Messages
- 3
I need to compose emails using VBA with signature in EXCEL 2016. I followed an tutorial on YouTube. This is the code I used, exactly same as the youtuber's but it works on his computer, not mine.
Sub PrepareEmailNow()
Dim olApp As Outlook.Application
Dim olEmail As Object
Dim sig As String
Set olApp = New Outlook.Application
Set olEmail = olApp.CreateItem(olMailItem)
With olEmail
.BodyFormat = olFormatHTML
.To = "Christina.Y.McDonald@ey.com"
.Subject = "Legal Invoices"
.Display
.HTMLBody = "Cindy," & "<br>" & "I love working here." & .HTMLBody
End With
End Sub
when it comes to the line:
Sub PrepareEmailNow()
Dim olApp As Outlook.Application
Dim olEmail As Object
Dim sig As String
Set olApp = New Outlook.Application
Set olEmail = olApp.CreateItem(olMailItem)
With olEmail
.BodyFormat = olFormatHTML
.To = "Christina.Y.McDonald@ey.com"
.Subject = "Legal Invoices"
.Display
.HTMLBody = "Cindy," & "<br>" & "I love working here." & .HTMLBody
End With
End Sub
when it comes to the line:
.HTMLBody = "Cindy," & "<br>" & "I love working here." & .HTMLBody,
it throws error 287: application defined or object defined error
I tried other ways, but the signature wont show. C
</strike>
it throws error 287: application defined or object defined error
I tried other ways, but the signature wont show. C
ould someone here help me? Thank you!
<strike></strike>