Hi all,
I have this script to create an email in outlook and it works fine, however....
If i merge the html body of the email with the standard signature and i try to set the font size to 12 it doesn't seem to work.
font size 11 and 13 work, but 12 doesn't. Isn't that strange? Does anyone know what's the problem here?
Hereby my script. It's nice and tiny:
I have this script to create an email in outlook and it works fine, however....
If i merge the html body of the email with the standard signature and i try to set the font size to 12 it doesn't seem to work.
font size 11 and 13 work, but 12 doesn't. Isn't that strange? Does anyone know what's the problem here?
Hereby my script. It's nice and tiny:
VBA Code:
Sub SendEmailWithSignature()
Dim OutApp As Object
Dim OutMail As Object
Dim EmailBody As String
Dim OutAccount As Object
Set OutApp = CreateObject("Outlook.Application") ' Start Outlook application
Set OutMail = OutApp.CreateItem(0) ' 0 create e-mail item
For Each OutAccount In OutApp.Session.Accounts ' choosing the email account
Debug.Print OutAccount.SmtpAddress
If OutAccount.SmtpAddress = "info@example.com" Then ' going through the email accounts to find the right one
Set OutMail.SendUsingAccount = OutAccount
EmailBody = "Dear,<br><br>This is an example.<br><br>Best regards"
OutMail.Display ' load email to make sure the standard signature is loaded also
OutMail.HTMLBody = "<div style='font-size:12pt'>" & EmailBody & "</div>" & OutMail.HTMLBody ' combining the contents with the signature
OutMail.To = "to@example.com"
OutMail.Subject = "here comes the subject"
OutMail.Save
Exit For
End If
Next OutAccount
Set OutMail = Nothing
Set OutApp = Nothing
End Sub