Solved

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

Posted on 2011-09-12
5
903 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
Comment Utility
using objMail.HTMLbody, you need to change your vbcrlf with <br>
0
 

Author Closing Comment

by:newbie46
Comment Utility
Thank you!
0
 

Author Comment

by:newbie46
Comment Utility
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
Comment Utility
0
 
LVL 21
Comment Utility
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

772 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

10 Experts available now in Live!

Get 1:1 Help Now