Bold text in Vb

Groundrush

Registered User.
Local time
Today, 19:39
Joined
Apr 14, 2002
Messages
1,376
Just a quickie for the experts in vb.

I am using this interesting bit of code that I found that emails data from access and it works great.

I am now trying to work out how to make the data appear as BOLD text in the email.

Not all the text just the data returned from Access

Here is part of the code I am using

thanks in advance



strEMailMsg = " Joanne has requested the following New Property/Recharge Code to be entered into Concept:." & Chr(10) & Chr(10) _
& "Request Dated:" & rst![DateOfRequest] & Chr(10) & Chr(10) _
& "New Property Name: " & rst![PropertyName] & Chr(10) & Chr(10) _
& "Address 1:" & rst![Address1] & Chr(10) & Chr(10) _
& "Address 2:" & rst![Address2] & Chr(10) & Chr(10) _
& "Address 3:" & rst![Address3] & Chr(10) & Chr(10) _
& "Address 4:" & rst![Address4] & Chr(10) & Chr(10) _
& "Post Code:" & rst![PostCode] & Chr(10) & Chr(10) _
& "Assign to Contract No:" & rst![ContractNo] & Chr(10) & Chr(10) _
& "Contract Name:" & rst![ContractName] & Chr(10) & Chr(10) _
& "Code No:" & rst![CodeNo] & Chr(10) & Chr(10) _
& "Recharge Code:" & rst![RechargeCode] & Chr(10) & Chr(10) _
& "Requested By:" & rst![RequestedBy] & Chr(10) & Chr(10) _
& "Further Notes:" & rst![Notes] & Chr(10) & Chr(10)

'EMAIL USER DETAILS & ATT REPORT
DoCmd.SendObject , , acFormatRTF, strEmailAddress, _
, , strSubject, strEMailMsg, False, False
rst.MoveNext
Loop
rst.Close
Set rst = Nothing
dbs.Close
Set dbs = Nothing

'Run update to update the sent mail check box
DoCmd.SetWarnings False
DoCmd.RunSQL "UPDATE tblNewProperty SET tblNewProperty.Mailsent = -1 WHERE (((tblNewProperty.Mailsent)=0))"
DoCmd.SetWarnings True
MsgBox "The email has been sent", vbInformation, "Thank You"
End If
End Sub
 
Last edited:
Just as a hint for future use:

You can create an RTF file (Using MicroSoft Word) and then open it using the NotePad application. This will return the code behind the RTF so that you can return the formating that you are looking for.

In this case Bold is \b

& "Request Dated:" & rst![DateOfRequest] & Chr(10) & Chr(10) _

becomes

& "Request Dated: {\b" & rst![DateOfRequest] & "}" & Chr(10) & Chr(10) _
 
Fantastic

Learn't another good tip

Cheers:p
 
Travis

The example you gave does not work

but I get the idea though.

cheers
 

Users who are viewing this thread

Back
Top Bottom