I'm using the following in VBA to send an email using Outlook...
I .Display the email first and then add to the body so the signature appears. The only problem I am having is that the signature formatting gets reset to default. Is there anyway to keep this formatting?
Thanks!
Code:
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
Ray = Split(txtRequestedFor.Text, " ")
strbody = Ray(0) & "," & Chr(10) & Chr(10) _
& "According to our records, the deployment information for the following assets is still required." _
& Chr(10) & Chr(10) & "Assets..." & Chr(10) & txtItemsRequested.Text & Chr(10) & Chr(10) _
& "Serial Numbers..." & Chr(10) & txtSerials.Text & Chr(10) & Chr(10) & "Information Required..." _
& Chr(10) & txtRequiredInfo.Text & Chr(10) & Chr(10) & "It has been " & lblDaysWaiting.Caption _
& " days since these assets have been delivered to you. Please provide this information ASAP." _
& Chr(10) & Chr(10) & "Thanks in advance,"
On Error Resume Next
With OutMail
.To = txtRequestedFor.Text
.CC = ""
.BCC = ""
.Subject = txtWO.Text
.Display
.Body = strbody & .Body
End With
On Error GoTo 0
I .Display the email first and then add to the body so the signature appears. The only problem I am having is that the signature formatting gets reset to default. Is there anyway to keep this formatting?
Thanks!