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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Carriage Returns in Email Message Text

Status
Not open for further replies.

aregan1

Programmer
Feb 12, 2002
46
US
Hi everyone -

I'm currently running Access 2000, and using Netscape Communicator 4.77 to send email messages.

I'm trying to format an email message to include carriage returns, but haven't been successful. I have tried all the options you see below in the code, and all of them give me the same result, which is that line 2 of the email message immediately follows line 1, on the same line (as follows):

Media Services acknowledges your request for the following Media resources: Event: Student Teaching Seminar

What I want to see is this:

Media Services acknowledges your request for the following Media resources: (a carriage return here)
Event: Student Teaching Seminar

My code follows:


' strMessage = "Media Services acknowledges your request for the following resources:" & vbCrLf
' strMessage = "Media Services acknowledges your request for the following resources:" & vbNewLine
' strMessage = "Media Services acknowledges your request for the following resources:" & Chr(10) & Chr(13)
strMessage = "Media Services acknowledges your request for the following resources:" & Chr(13) & Chr(10)
strMessage = strMessage & "Event: " & Me!EventTitle.Value

DoCmd.SendObject , , acFormatRTF, strEmail, , , "Media Services Confirmation", strMessage, True

Can anyone offer a suggestion? It seems that most of you use Outlook for email, and I've read in this forum that these various options work with Outlook. Could my problem be that Netscape can't handle these characters?

Thanks in advance for your help...

- Anita

 
this is what i use...

strMessage = "Media Services acknowledges your request for
the following resources:" & vbCrLf & "Event: " & Me!
EventTitle.Value

Might i suggest that you keep it all in one line, that might help...

--James junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
I've never used the SendObject method, but what if you tried chaning the output type to acFormatTXT
What if you try changing it to acFormatHTML and sent HTML code, ex. a <br> between your lines?
 
Hi James and Dan -

I tried the suggestion of putting all the strMessage code on one line, but the results were the same.

Then I tried changing the outputformat to acFormatTXT, and that also didn't change anything.

Then I tried changing the outputformat to acFormatHTML. I also changed the strMessage code to the following:

strMessage = &quot;Media Services acknowledges your request for the following resources:&quot; < br > &quot;Event: &quot; & Me!EventTitle.Value
DoCmd.SendObject , , acFormatHTML, strEmail, , , &quot;Media Services Confirmation&quot;, strMessage, True

What displays in my email message now is simply the word &quot;False&quot;, and nothing else. I get no errors. Since I'm not too familiar with HTML code, can you tell me how I should have coded the strMessage (or offer any other suggestions)?

Thanks for your help...

- Anita
 
well, one thing I noticed was you put <br> out side the &quot;'s...

They should be inside, that'll be part of the text sent...

besides that, I don't know html well enough to help more then that...

--James
junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
James, your last bit of advice worked! I changed the code to read:

strMessage = &quot;Media Services acknowledges your request for the following resources: <br><br>&quot; & &quot;Event: &quot; & Me!EventTitle.Value
DoCmd.SendObject , , acFormatHTML, strEmail, , , &quot;Media Services Confirmation&quot;, strMessage, True

and the resulting message looked like this:


Media Services acknowledges your request for the following resources:

Event: Student Teaching Seminar


So I guess I'll have to create the email message in HTML format. Thanks so much for your help!:->

- Anita
 
Sorry I couldn't help more... But I'm glad you got it to work...

--James
junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
Anita, woops, I should of specified that the <br> needed to be within the quotes. Glad you got it working.

Laters,
Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top