Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I user fontbold in vba e-mail from ms access

Status
Not open for further replies.

elvanace

IS-IT--Management
Sep 26, 2002
23
US
I have tried several ways to make a field bold, but I can't get it to work. I want to have the field 'CancellationReason' print bold in an email generated using vba from ms access. Here's my code:

Set rstSendEmail = CurrentDb.OpenRecordset("SELECT dbo_tblAttendees.ClockID, dbo_tblEmployee.EMail, dbo_tblAttendees.ClassID, dbo_tblAttendees.status, dbo_tblAttendees.EMail4, dbo_tblAttendees.EMail5 FROM dbo_tblAttendees INNER JOIN dbo_tblEmployee ON dbo_tblAttendees.ClockID = dbo_tblEmployee.ClockID WHERE (((dbo_tblAttendees.ClassID)='" & Trim(ClassID) & "') AND ((dbo_tblAttendees.status)='Attendee') OR ((dbo_tblAttendees.status)='Waitlist'))", , dbSeeChanges)

Count = 0
If Not rstSendEmail.BOF Then ' Check for no records

strSubjectLine = "NexPrise Owner/Co-owner Certification Class Cancellation"
strMsgBody = _
"This is to update you regarding today's NexPrise Class: " & Trim(ClassID) & "-" & Trim(ClassName) & " at " & Trim(ClassStartTime) & ". " & CancellationReason & _
". We will move you to the next available class and you will receive another invitation shortly. " & vbCrLf & vbCrLf & _
"Thanks, " & vbCrLf & vbCrLf & _
"Your NexPrise Support Team" & vbCrLf
strSendToList = ""
rstSendEmail.MoveFirst
While Not rstSendEmail.EOF

strSendTo = Nz(Trim(rstSendEmail!EMAIL), "")
strSendToList = strSendToList + IIf(Len(strSendToList) > 0, "; ", "") + strSendTo

rstSendEmail.Edit
CancellationDate = Date
rstSendEmail.Update
Count = Count + 1
rstSendEmail.MoveNext
Wend

If Len(strSendToList) > 0 Then
intFxn = SendEMail(strSendToList, strSubjectLine, strMsgBody)
End If
CancelledCount = Count
ClassStatus = "Canceled"
End If

Can you help me please?
 
I have found the easiest way to format email messages is to create the string as if it is a HTML document
strmsg="<html><body> Hello <b>FRIEND</b> </body></html>"
then set
objOutlookmsg.HTMLBody = strMsg
when you come to add to the message object before sending - probably need to amend your SendEmail function - it will have the .Body method

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top