Solved

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

Posted on 2011-09-12
5
939 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 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Access syntax 1 33
Item not found in this collection 5 29
access query - filter field for particular number format 3 26
What can I do to shrink my Access Frontend? 12 42
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Familiarize people with the process of utilizing SQL Server functions 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 Ac…
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.

685 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