Hi, newbie here. First time asking for help from anywhere so please bear with me while I learn the rules. The following code does not throw an error but my displayed email shows the boilerplate from my template in Calibri 10 (which is what I want) but the data pulled from Excel renders as Times New Roman 12 even though I surrounded the references with the HTML Calibri font and font size of 10 pt. In a related question, can anyone explain why whenever I try to use Ron's RangetoHTML Function, my template boilerplate shows up in Outlook as a Table? Thanks in advance.
VBA Code:
VBA Code:
VBA Code:
Sub OpenAndModifyTemplate()
Dim vOL As Object
Dim vItem As Object
Dim vStr As String
Set vOL = CreateObject("Outlook.Application")
Set vItem = vOL.CreateItemFromTemplate("C:\Users\Microsoft\Templates\LH.oft")
With vItem
.Display
.Subject = "EID"
.To = ActiveSheet.Range("J2").Value
.HTMLBody = "<font face=""calibri"" style=""font-size:10pt;"">" & ActiveSheet.Range("F2").Value & "<br>" & ActiveSheet.Range("E2").Value & "<br><br>" & "Dear " & ActiveSheet.Range("N2").Value & ":" & .HTMLBody & "</font>"
.Display
End With
Set vItem = Nothing
Set vOL = Nothing
End Sub