text formating

B

bil

I have a form that will xfer data to an email - this works perfectly...
i would like to know how to do the following though:

1) bold [First Name] in the MessageText field (leave the rest unbolded)
2) increase the size of the font of all the fields in the MessageText -
EXCEPT the [Terms] field.
3) it seems i've reached the maximum amount of text that i can put on a
single line (in vb) how do i add more text? i would like to add more text
to the email but VB wont let me.

any help is greatly appreciated.


sample code below...


Private Sub Command19_Click()

DoCmd.SendObject acSendNoObject, _
To:=, _
Subject:="Ref# " & [Ref #] & " - " & "Pricing for shipments from
" & [Origin] & " to " & [Destination], _
MessageText:="Dear " & [First Name] & ", " & vbCr & "Please see
the following rates as per our conversation." & vbCr & vbCr & "Origin: " &
[Origin] & " Destination: " & [Destination] & vbCr & "Commodity: "
& [Commodity] & vbCr & "Dims: " & [Dims] & vbCr & "Weight: " & [Weight] & "
Chargeable Weight: " & [chargeable weight] & vbCr & "Value: " & "$" &
[Value] & " " & [value currency] & vbCr & "Equipment Required: " &
[Equipment] & vbCr & vbCr & "Rate: " & [rate memo field] & vbCr & vbCr &
"Terms: " & vbCr & [Terms] & vbCr & vbCr & "If you have any questions or
would like me to arrange pickup, please contact us by email." & vbCr & vbCr
& "I look forward to speaking with you soon." & vbCr & vbCr & "Sincerely, "
& vbCr & [User] & " " & [Lastname] & "," & vbCr & "Cargo Partners -" &
[Title], _

EditMessage:=True
 
J

John Nurick

I have a form that will xfer data to an email - this works perfectly...
i would like to know how to do the following though:

1) bold [First Name] in the MessageText field (leave the rest unbolded)
2) increase the size of the font of all the fields in the MessageText -
EXCEPT the [Terms] field.

As far as I know neither of these can be done with DoCmd.SendObject.
You'll need to build a string containing HTML or RTF formatting codes
and use another technique to create an email from it. See Tony Toews's
email FAQ at http://www.granite.ab.ca/access/email.htm for more.
3) it seems i've reached the maximum amount of text that i can put on a
single line (in vb) how do i add more text? i would like to add more text
to the email but VB wont let me.

Declare a string variable and concatenate your stuff into that, then
pass it to SendObject. Up to a point you can use the VB line
continuation code " _" to make things more readable.

Dim strMessage As String

strMessage = "Dear " & [FirstName] & "," & vbCrLf _
& "Please see the following rates as per our conversation." _
& vbCrLf & vbCrLf

strMessage = strMessage & "Origin: " & [Origin] & vbTab _
& "Destination: " & [Destination] & vbCrLf _
& "Commodity: " & [Commodity] & vbCrLf

....

DoCmd.SendObject blah blah MessageText:=strMessage blah blah
....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top