我有附件创建收据以通过电子邮件发送给客户。 我试图让第二个字段对齐Outlook电子邮件,但迄今未能找到解决方案。已经尝试过Chr9,vbTab,只是增加空格等。 解决方案将不胜感激 - 我不认为它是一个巨大的任务来解决,但它目前证明难以捉摸。Excel创建Outlook电子邮件,但文本不对齐
Sub GenerateEmails()
Dim ce As String: ce = "[email protected]"
'create draft emails
Dim OutApp As Object, OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
On Error GoTo cleanup
If ce Like "?*@?*.?*" Then
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.TO = ce
.CC = ""
.Subject = "Receipt"
.Body = "Payment Amount: " & "$10,000" & vbNewLine & _
"Receipt Num: " & "R645-81658" & vbNewLine & _
"Sales Rep: " & "Ben Smith" & vbNewLine & _
"Date Received: " & "05 July 2016"
.Display
End With
On Error GoTo 0
Set OutMail = Nothing
End If
cleanup:
Set OutApp = Nothing
Application.ScreenUpdating = True
End Sub
感谢
您是否尝试过使用HTML格式发送并使用表格? –