且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用 VBA 格式化电子邮件正文

更新时间:2023-10-04 20:58:28

如果你使用 .HTMLBody 那么你应该使用 HTML Tags.
试试这个:

If you use .HTMLBody then you should write it using HTML Tags.
Try this:

Dim EBody as String

EBody = "Please accept this email as confirmation that xxxx has received your road defect notification." & "<br>" _
    & "xxxxx will investigate and action your notification according to priority and to ensure public safety." & "<br>" _
    & "For further information, please phone xxxxx on 4221 6111 and quote reference number:" & "<br>" _
    & IDnumber & "Your original report can be seen below:" & "<br>" _
    & reportbody

With NewForward
    .Subject = "'TEST' Hazard report reciept number: HAZ" & IDnumber
    .To = strSender
    .BCC = "xxxxxxxxxxxx"
    .HTMLBody = Ebody
    .Send
End With

希望这对你有用.
此外,您的 reportbody 应该使用 HTML 标签 采用相同的格式.

Hope this works for you.
Also your reportbody should be in the same format using HTML Tags.