How to Format Email message with code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hallo

I hope some one can help me a little I have a form with 2 fields on it where
I enter some info and then I want to by click of a button send an email to
address.

Sending the email is not hard I have the code for that but my problem is
formatting the Email body text like I want it I have some predefined text.
Basically I want the body text to look like this


Hallo

Please do this

[Field1]

Some more text:

[Field2]

and some more text

Is this some how possible its kind urgent
 
Depending upon how you are sending the message, format the message body in
your code like this:

strMessage = "Hello" & vbCrLf & vbCrLf & "Please do this" & vbCrLf & _
vbCrLf & [Field1] & vbCrLf & vbCrLf & "Some more
text" & _
[Field2] & vbCrLf & vbCrLf & "and some more text"
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
Thank you just one more question is it possible to underline or make words bold

Regards
Markus Mortsiefer

Arvin Meyer said:
Depending upon how you are sending the message, format the message body in
your code like this:

strMessage = "Hello" & vbCrLf & vbCrLf & "Please do this" & vbCrLf & _
vbCrLf & [Field1] & vbCrLf & vbCrLf & "Some more
text" & _
[Field2] & vbCrLf & vbCrLf & "and some more text"
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

Markus said:
Hallo

I hope some one can help me a little I have a form with 2 fields on it where
I enter some info and then I want to by click of a button send an email to
address.

Sending the email is not hard I have the code for that but my problem is
formatting the Email body text like I want it I have some predefined text.
Basically I want the body text to look like this


Hallo

Please do this

[Field1]

Some more text:

[Field2]

and some more text

Is this some how possible its kind urgent
 
No, it's not.

The only way you'd be able to do that is to create your own form, rather
than using the MsgBox command, and even then you'd need to add an RTF
control in order to be able to mix bold, underline and plain text.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Markus said:
Thank you just one more question is it possible to underline or make words bold

Regards
Markus Mortsiefer

Arvin Meyer said:
Depending upon how you are sending the message, format the message body in
your code like this:

strMessage = "Hello" & vbCrLf & vbCrLf & "Please do this" & vbCrLf & _
vbCrLf & [Field1] & vbCrLf & vbCrLf & "Some more
text" & _
[Field2] & vbCrLf & vbCrLf & "and some more text"
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

Markus said:
Hallo

I hope some one can help me a little I have a form with 2 fields on it where
I enter some info and then I want to by click of a button send an email to
address.

Sending the email is not hard I have the code for that but my problem is
formatting the Email body text like I want it I have some predefined text.
Basically I want the body text to look like this


Hallo

Please do this

[Field1]

Some more text:

[Field2]

and some more text

Is this some how possible its kind urgent
 
Back
Top