vba 邮件body html,Excel VBA中的Outlook电子邮件和签名 – .Body vs .HTMLbody
我的工作表上有一個按鈕來發送電子郵件(加上更多,但不重要).我想要我的默認簽名及其HTML格式,但兩個選項都沒有產生我想要的結果:
> .Body生成正確的正文(字體和回車),但簽名是純文本
> .HMTLBody產生正確的簽名但由于某種原因身體,字體轉到Times New Roman而不是默認的Calibri,并且無論我使用vbNewLine,vbCr還是vbCrLf,回車都不起作用
我只是S.O.L.?我需要選擇一個并處理它,還是有辦法讓我吃蛋糕也吃它?
碼:
.Display ' need to display email first for signature to work
.Subject = Title
.To = ActiveSheet.Range("E10").Value '
.CC = "" '
.HTMLBody = "Thank you for the opportunity to bid on " & ActiveSheet.Range("B9").Value & ". " & _
" Please read our attached proposal in its entirety to be sure of all inclusions, exclusions, and products proposed. Give us a call with any questions or concerns." & _
vbCrLf & vbCrLf & _
"Thank you," & _
.HTMLBody ' Adds default signature
.Attachments.Add PdfFile
更新:
最后的工作代碼歸功于以下兩個答案的幫助:
.Display ' We need to display email first for signature to be added
.Subject = Title
.To = ActiveSheet.Range("E10").Value
.CC = ""
.HTMLBody = "Thank you for the opportunity to bid on " & ActiveSheet.Range("B9").Value & ". " & " Please read our attached proposal in its entirety to be sure of all inclusions, exclusions, and products proposed. Give us a call with any questions or concerns." & _
"
" & _
"Thank you," & _
.HTMLBody & "" ' Adds default signature
.Attachments.Add PdfFile
總結
以上是生活随笔為你收集整理的vba 邮件body html,Excel VBA中的Outlook电子邮件和签名 – .Body vs .HTMLbody的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 动画都要用计算机图形学吗,计算机图形学在
- 下一篇: 地球环绕 html5,玩转html5(五