I am pretty new to JavaScript / jQuery and hope someone here can help me with the following:
I am using the following VBA code in an Excel file in order to prepare a formatted email in Outlook. The code is short, easy to adjust and works perfect, incl. preparing the email recipient, the subject and the HTML body.
As this works without issues in VBA I hope there is also a way to achieve the same in JavaScript / jQuery. I tried mailto. This works for the recipient and subject but not for the HTML body which is displayed as plain text instead.
My VBA code (working):
Sub Test()
Dim olApp As Object
Dim olOldBody As String
Set olApp = CreateObject("Outlook.Application")
With olApp.CreateItem(0)
.GetInspector.Display
olOldBody = .HTMLBody
.Importance = 2
.To = "[email protected]"
.Cc = ""
.Bcc = ""
.Subject = "My subject text"
.HTMLBody = "<span style='font-family: Arial, Helvetica, sans-serif; font-size:11pt; color: #00457C;'>" & _
"<strong>Title1:</strong>Line1<br />" & _
"<strong>Title2:</strong>Line2<br />" & _
"<strong>Title3:</strong>Line3<br /></span>" & olOldBody
.Display
End With
End Sub
Thanks for any help with this, Tim