简体   繁体   中英

Excel/vba latebinding HTML email

I have some code written in VBA designed to run in excel which is supposed to send a html email. This worked fine originally but I have tried to late bound me code, an email is still sent however the HTML appears as plain text to the recipient. The code I have is:

Dim oAPP As Object
Dim oItem As Object
Const olMailItem As Long = 0
Set oAPP = CreateObject("Outlook.Application")
Set oItem = oAPP.CreateItem(olMailItem)
With oItem
    .To = Worksheets("Emails").Cells(1, 2).Value
    .Subject = "Product set-up request"
    .BodyFormat = 2
    .Body = emailbody
    .send
End With

.Body = emailbody更改为.HTMLBody = emailbody

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM