Wondering if anyone understands why this is happening?
I'm sending an email with excel VBA using a template file (.oft) because this allows me to set other variable like (e.i. request read receipt) in the template instead of the code. Also allows me to set different templates for different needs.
But when:
The Code
I'm sending an email with excel VBA using a template file (.oft) because this allows me to set other variable like (e.i. request read receipt) in the template instead of the code. Also allows me to set different templates for different needs.
But when:
- I use .display the signature from the template is there
- I use .send the signature from the template is gone!!!
- I use the combination of .display, wait 2 seconds, .send the signature is there?
The Code
HTML:
Sub smail()
Dim OutApp As Object
Dim OutMail As Object
Dim cell As Range
Dim txt As String
txt = "This is the body of the email"
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.createItemFromtemplate("C:\Users\dcharland\Information Meeting.oft")
With OutMail
.To = "dcharland@live.com" ' Write the recepient email
.Subject = "This is the Subject" 'Writes the subject line
.HTMLBody = txt
.Display ' Signature is there!
' Application.Wait (Now + TimeValue("0:00:02")) ' Put a 2 second delay between sending each emails
' .Send ' this combination works.
'.Send ' only Signature is Gone?
End With
End Sub