problem inserting new line character into string

M0E-lnx

Registered User.
Local time
Today, 16:42
Joined
Sep 3, 2008
Messages
62
Situation:
I have a VBA function that collects information from the current excel worksheet and some text files on my system. Uses this information to generate an email, and attaches a copy of the current worksheet to the email.

All works fine, and it really works wonders... saves me a ton of time, and clicking around.

Problem:
The text in the body of the email is somewhat automagically generated. Typically, it contains 3 lines of text.

For some reason, I cannot get this thing to separate these lines. I've tried everything I could think of.
Here is an example of the body text.

"Please ship today" & vbcrlf & "Contact <name> at <ph number>" & vbcrlf & "Thank you"

I've also tried using vbNewLine, chr(13), chr(10) but no matter what I try, the text always displays on a single line.

Does anyone have any idea of how I could fix this annoyance?
Using excel 2003 here

Thanks in advance
 
Anyone ran into this problem before?

Yeah, when trying to send it wanted to go as HTML so I had to add a <BR> in there to break the lines intead of the vbCrLf.
 
Thank you.. I never realized that... works like a charm.

It's been annoying me for months.
 
Glad to hear that worked. It is funny as I just had to do this recently and wouldn't have had a clue otherwise. :)
 
Me neither... I've been having to manually edit the body string to format it correctly.
 

Users who are viewing this thread

Back
Top Bottom