Link to home
Start Free TrialLog in
Avatar of newbie46
newbie46

asked on

How do I change font within email generated by vba?

Dim objOL As Object
Dim objMail As Object
Set objOL = CreateObject("Outlook.Application")
Set objMail = objOL.CreateItem(olMailItem)

strBody = "Attached, please find a copy of the " &  NameofCompanyBolded & _
" letter for your review, and an electronic version of the Questionnaire.  A paper copy of these documents is also being sent to you." & vbCrLf & vbCrLf & _
"Please let me know if you have any questions."

objMail.To = strTo
objMail.CC = strCC
objMail.BCC = strBcc
objMail.Subject = strSubject
 
'Display Email
objMail.Display

objMail.body = strBody & objMail.body & vbCrLf & AfterSignatureCCs

I closed this question prematurely without the following question having been answered.

Questions:
1)  How do I set the font of the email text to Calibri 11 pt.?
Avatar of Nick67
Nick67
Flag of Canada image

<No Points wanted>

HTML like this:
<p style="font-size:7pt; font-family:calibri;">This is Calibri Text 7 point</p>

Will produce what you are asking for: Calibri font at 7 points
So to do a complete block of text with line breaks, <br>, would start out like this:

<p style="font-size:7pt; font-family:calibri;">This is Calibri Text 7 point on line 1<br>This is Calibri Text 7 point on line 2</p>
Avatar of newbie46
newbie46

ASKER

boaq2000,
Where does the  <p style .... go? Is it added as seen below?

objMail.HTMLbody = <p style="font-size:7pt; font-family:calibri;">This is Calibri Text 7 point</p> & 
strBody & objMail.body & "<br>" & AfterSignatureCCs
ASKER CERTIFIED SOLUTION
Avatar of Jeffrey Coachman
Jeffrey Coachman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
^
Yes, use Nicks syntax.

My post was just and example of a short string...
;-)