【发布时间】:2021-12-26 21:13:17
【问题描述】:
我需要在生成的 Outlook 电子邮件末尾添加我的签名。
我将我的 (.HTMLBody = msg) 更改为 (.HTMLBody = msg & .HTMLBody)。这让我的签名显示出来,但我的消息文本消失了。当我在最后删除 .HTMLBody 并使用我的原始代码时,我的文本显示格式正确但没有签名。
Sub Email()
Dim OutApp As Object
Dim OutMail As Object
Dim Path As String
Dim strbody As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
msg = "<p>Hello World,</p><br>"
On Error Resume Next
With OutMail
.Display
.To = ""
.CC = ""
.BCC = ""
.Subject = "Fruits Stock " & Path
.HTMLBody = msg & "Hello World" & .HTMLBody
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
【问题讨论】: