Solved

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

Posted on 2011-09-12
5
946 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) 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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

695 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