ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to get e new line in html email (Ron De Bruin's code) (https://www.excelbanter.com/excel-programming/425143-how-get-e-new-line-html-email-ron-de-bruins-code.html)

Mark Stephens

How to get e new line in html email (Ron De Bruin's code)
 
Hi,

Everything is fine until I want a html signature at which time the code
stops recognising the new line instruction.

Here's the relvant bits of the code the first works fine the second has the
problem, both codes are the same except the line:

.Body = strbody & vbNewLine & vbNewLine & Signature

changes to

.HTMLBody = strbody & vbNewLine & vbNewLine & Signature



Here's the code:

psCustomerName = "John Smith"

strbody = "Dear " & psCustomerName & "," & vbNewLine & vbNewLine & _
"This is line 1" & vbNewLine & _
"This is line 2" & vbNewLine & _
"This is line 3" & vbNewLine & _
"This is line 4":

With OutMail
.Body = strbody & vbNewLine & vbNewLine & Signature


The plain text code outputs an email that looks like:

Dear John Smith,
This is line 1
This is line 2
This is line 3
This is line 4

The HTML code outputs an email that looks like:

Dear Wilddan, This is line 1 This is line 2 This is line 3 This is line 4

Regards,



Can anyone tell me how I can find some instructions on how to format a html
email so it comes out how I want?



Thanks for your help, Mark





Regards,



Ritwik Shukla[_2_]

How to get e new line in html email (Ron De Bruin's code)
 
Use & vbCrLf for new line...
For example

If you wana write:

Regards,
Ritwik
Then the code is
------------------
"Regards," & vbCrLf & _
"Ritwik"
----------------
And if its

Regards

Ritwik

Then the code is
------------------------
"Regards," & vbCrLf & _
vbCrLf & _
"Ritwik"
------------------------







"Mark Stephens" wrote:

Hi,

Everything is fine until I want a html signature at which time the code
stops recognising the new line instruction.

Here's the relvant bits of the code the first works fine the second has the
problem, both codes are the same except the line:

.Body = strbody & vbNewLine & vbNewLine & Signature

changes to

.HTMLBody = strbody & vbNewLine & vbNewLine & Signature



Here's the code:

psCustomerName = "John Smith"

strbody = "Dear " & psCustomerName & "," & vbNewLine & vbNewLine & _
"This is line 1" & vbNewLine & _
"This is line 2" & vbNewLine & _
"This is line 3" & vbNewLine & _
"This is line 4":

With OutMail
.Body = strbody & vbNewLine & vbNewLine & Signature


The plain text code outputs an email that looks like:

Dear John Smith,
This is line 1
This is line 2
This is line 3
This is line 4

The HTML code outputs an email that looks like:

Dear Wilddan, This is line 1 This is line 2 This is line 3 This is line 4

Regards,



Can anyone tell me how I can find some instructions on how to format a html
email so it comes out how I want?



Thanks for your help, Mark





Regards,




Ronald R. Dodge, Jr.[_2_]

How to get e new line in html email (Ron De Bruin's code)
 
Just as Ritwik said, use the vbCRLF in place of vbNewLine

Why?

If you go back to the old manual type writer days, New Line (aka Line Feed
hence the LF part of the constant) meant only going down a line, it didn't
take the point of the next strike to be on the left side of the page. The
term they used to describe this action was "Carriage Return", hence the CR
part of the constant.

Carriage return doesn't change the line just like line feed doesn't change
the relative position of the cursor from the left edge, so it takes both to
get the effect you are looking for.

--
Thanks,

Ronald R. Dodge, Jr.
Production Statistician
Master MOUS 2000
"Mark Stephens" wrote in message
...
Hi,

Everything is fine until I want a html signature at which time the code
stops recognising the new line instruction.

Here's the relvant bits of the code the first works fine the second has
the problem, both codes are the same except the line:

.Body = strbody & vbNewLine & vbNewLine & Signature

changes to

.HTMLBody = strbody & vbNewLine & vbNewLine & Signature



Here's the code:

psCustomerName = "John Smith"

strbody = "Dear " & psCustomerName & "," & vbNewLine & vbNewLine & _
"This is line 1" & vbNewLine & _
"This is line 2" & vbNewLine & _
"This is line 3" & vbNewLine & _
"This is line 4":

With OutMail
.Body = strbody & vbNewLine & vbNewLine & Signature


The plain text code outputs an email that looks like:

Dear John Smith,
This is line 1
This is line 2
This is line 3
This is line 4

The HTML code outputs an email that looks like:

Dear Wilddan, This is line 1 This is line 2 This is line 3 This is line 4

Regards,



Can anyone tell me how I can find some instructions on how to format a
html email so it comes out how I want?



Thanks for your help, Mark





Regards,





Mark Stephens

How to get e new line in html email (Ron De Bruin's code)
 
Thanks very much for your input guys but unfortunately it doesn't woek, I
still get no line underneath the Dear x,

Any other ideas?

Regards, Mark


"Ronald R. Dodge, Jr." wrote in message
...
Just as Ritwik said, use the vbCRLF in place of vbNewLine

Why?

If you go back to the old manual type writer days, New Line (aka Line Feed
hence the LF part of the constant) meant only going down a line, it didn't
take the point of the next strike to be on the left side of the page. The
term they used to describe this action was "Carriage Return", hence the CR
part of the constant.

Carriage return doesn't change the line just like line feed doesn't change
the relative position of the cursor from the left edge, so it takes both
to get the effect you are looking for.

--
Thanks,

Ronald R. Dodge, Jr.
Production Statistician
Master MOUS 2000
"Mark Stephens" wrote in message
...
Hi,

Everything is fine until I want a html signature at which time the code
stops recognising the new line instruction.

Here's the relvant bits of the code the first works fine the second has
the problem, both codes are the same except the line:

.Body = strbody & vbNewLine & vbNewLine & Signature

changes to

.HTMLBody = strbody & vbNewLine & vbNewLine & Signature



Here's the code:

psCustomerName = "John Smith"

strbody = "Dear " & psCustomerName & "," & vbNewLine & vbNewLine & _
"This is line 1" & vbNewLine & _
"This is line 2" & vbNewLine & _
"This is line 3" & vbNewLine & _
"This is line 4":

With OutMail
.Body = strbody & vbNewLine & vbNewLine & Signature


The plain text code outputs an email that looks like:

Dear John Smith,
This is line 1
This is line 2
This is line 3
This is line 4

The HTML code outputs an email that looks like:

Dear Wilddan, This is line 1 This is line 2 This is line 3 This is line 4

Regards,



Can anyone tell me how I can find some instructions on how to format a
html email so it comes out how I want?



Thanks for your help, Mark





Regards,







Ron de Bruin

How to get e new line in html email (Ron De Bruin's code)
 
VbNewLine is not working in HTML

Use this <br

strbody = "<H3<BDear Customer</B</H3" & _
"Please visit this website to download the new version.<br" & _
"Let me know if you have problems.<br" & _
"<A HREF=""http://www.rondebruin.nl/""Ron's Excel Page</A" & _
"<br<br<BThank you</B"


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Mark Stephens" wrote in message ...
Hi,

Everything is fine until I want a html signature at which time the code
stops recognising the new line instruction.

Here's the relvant bits of the code the first works fine the second has the
problem, both codes are the same except the line:

.Body = strbody & vbNewLine & vbNewLine & Signature

changes to

.HTMLBody = strbody & vbNewLine & vbNewLine & Signature



Here's the code:

psCustomerName = "John Smith"

strbody = "Dear " & psCustomerName & "," & vbNewLine & vbNewLine & _
"This is line 1" & vbNewLine & _
"This is line 2" & vbNewLine & _
"This is line 3" & vbNewLine & _
"This is line 4":

With OutMail
.Body = strbody & vbNewLine & vbNewLine & Signature


The plain text code outputs an email that looks like:

Dear John Smith,
This is line 1
This is line 2
This is line 3
This is line 4

The HTML code outputs an email that looks like:

Dear Wilddan, This is line 1 This is line 2 This is line 3 This is line 4

Regards,



Can anyone tell me how I can find some instructions on how to format a html
email so it comes out how I want?



Thanks for your help, Mark





Regards,



Mark Stephens

How to get e new line in html email (Ron De Bruin's code)
 
Thanks Ron, works a treat, now only one last (annoyingly small) hurdle to
overcome (isn't there always?!)...

Dear x,

Thank you for the brief conversation last night.


The first sentence is in calibri, the Dear x line in times new roman (don't
know why on earth it should be ... calibri is my default font)

I guess I need to use html body like i did for the signature but it seems a
lot big change to solve such a little problem, any ideas?

Thanks and regards, Mark



"Ron de Bruin" wrote in message
...
VbNewLine is not working in HTML

Use this <br

strbody = "<H3<BDear Customer</B</H3" & _
"Please visit this website to download the new version.<br"
& _
"Let me know if you have problems.<br" & _
"<A HREF=""http://www.rondebruin.nl/""Ron's Excel Page</A"
& _
"<br<br<BThank you</B"


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Mark Stephens" wrote in message
...
Hi,

Everything is fine until I want a html signature at which time the code
stops recognising the new line instruction.

Here's the relvant bits of the code the first works fine the second has
the problem, both codes are the same except the line:

.Body = strbody & vbNewLine & vbNewLine & Signature

changes to

.HTMLBody = strbody & vbNewLine & vbNewLine & Signature



Here's the code:

psCustomerName = "John Smith"

strbody = "Dear " & psCustomerName & "," & vbNewLine & vbNewLine & _
"This is line 1" & vbNewLine & _
"This is line 2" & vbNewLine & _
"This is line 3" & vbNewLine & _
"This is line 4":

With OutMail
.Body = strbody & vbNewLine & vbNewLine & Signature


The plain text code outputs an email that looks like:

Dear John Smith,
This is line 1
This is line 2
This is line 3
This is line 4

The HTML code outputs an email that looks like:

Dear Wilddan, This is line 1 This is line 2 This is line 3 This is line 4

Regards,



Can anyone tell me how I can find some instructions on how to format a
html email so it comes out how I want?



Thanks for your help, Mark





Regards,



[email protected][_2_]

How to get e new line in html email (Ron De Bruin's code)
 
Add HTML font tags to your code:

<font face="Times Roman"asdf</font


On Mar 6, 7:42*am, "Mark Stephens" wrote:
Thanks Ron, works a treat, now only one last (annoyingly small) hurdle to
overcome (isn't there always?!)...

Dear x,

Thank you for the brief conversation last night.

The first sentence is in calibri, the Dear x line in times new roman (don't
know why on earth it should be ... calibri is my default font)

I guess I need to use html body like i did for the signature but it seems a
lot big change to solve such a little problem, any ideas?

Thanks and regards, Mark

"Ron de Bruin" wrote in l...



VbNewLine is not working in HTML


Use this * <br


strbody = "<H3<BDear Customer</B</H3" & _
* * * * * * *"Please visit this website to download the new version.<br"
& _
* * * * * * *"Let me know if you have problems.<br" & _
* * * * * * *"<A HREF=""http://www.rondebruin.nl/""Ron's Excel Page</A"
& _
* * * * * * *"<br<br<BThank you</B"


--


Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Mark Stephens" wrote in message
...
Hi,


Everything is fine until I want a html signature at which time the code
stops recognising the new line instruction.


Here's the relvant bits of the code the first works fine the second has
the problem, both codes are the same except the line:


*.Body = strbody & vbNewLine & vbNewLine & Signature


changes to


*.HTMLBody = strbody & vbNewLine & vbNewLine & Signature


Here's the code:


psCustomerName *= "John Smith"


strbody = "Dear " & psCustomerName & "," & vbNewLine & vbNewLine & _
* * * * * * *"This is line 1" & vbNewLine & _
* * * * * * *"This is line 2" & vbNewLine & _
* * * * * * *"This is line 3" & vbNewLine & _
* * * * * * *"This is line 4":


With OutMail
*.Body = strbody & vbNewLine & vbNewLine & Signature


The plain text code outputs an email that looks like:


Dear John Smith,
This is line 1
This is line 2
This is line 3
This is line 4


The HTML code outputs an email that looks like:


Dear Wilddan, This is line 1 This is line 2 This is line 3 This is line 4


Regards,


Can anyone tell me how I can find some instructions on how to format a
html email so it comes out how I want?


Thanks for your help, Mark


Regards,- Hide quoted text -


- Show quoted text -




All times are GMT +1. The time now is 03:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com