Solved

Using vba from Access 2007, how do I bold text and change font size in email generated?

Posted on 2011-09-12
5
915 Views
Last Modified: 2012-05-12
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

Questions:
1) How do I display NameofCompanyBolded bolded?
2)  How do I set the font of the email text to Calibri 11 pt.?

When I use objMail.HTMLbody = "<b>" & text & "</b>" , the text is bolded, but then the carriage returns (vbcrlf) do not work.
0
Comment
Question by:newbie46
  • 2
  • 2
5 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 36523606
using objMail.HTMLbody, you need to change your vbcrlf with <br>
0
 

Author Closing Comment

by:newbie46
ID: 36523645
Thank you!
0
 

Author Comment

by:newbie46
ID: 36523658
Sorry, closed it too quickly.
What about
2) How do I set the font of the email text to Calibri 11 pt.?

0
 
LVL 21
ID: 36523852
0
 
LVL 21
ID: 36523894
FWIW:
 IIRC, Calibri is not a standard font.. Unless the recipient is on a device  with Office installed they may not have the font installed.

I stick to generic fonts that are also smartphone friendly.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now