Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Hot to get line break in macro generated email

Sorry if this has been asked before?
I haven't been able to find a thread that discusses this topic.

I have a macro which auto-generates emails using the following code:
______
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)

With OutMail
.To = recipient
.cc = manager
.BCC = ""
.Subject = "Reminder of Training/Certification Renewal"
.HTMLbody = EmailText
.Send '.display
End With
Set OutMail = Nothing
Set OutApp = Nothing
Application.ScreenUpdating = True
______

To create my email body (.HTMLbody = EmailText), i have a bunch of looped
code which generated some canned email message based on certain conditions in
my spreadsheet. I basically do so like this:
______
EmailText = EmailText & Chr(13) & "Your training/certification:"
....
....
EmailText = EmailText & Chr(13) & "It is your responsibility to arrange for
any renewal/recertification required. Please speak with your line manager for
approval of any training or re-training initiatives."
______

I am using Chr(13) {or alternatively Chr(10)} to try and create linebreaks
in my email. However, neither of these functions will generate an email with
line breaks (or carriage returns). I just end up with a continuous set of
text with a space in place of my line breaks.

All of my other code is working flawlessly generating my email, i just need
it to have proper line breaks.
I would really appreciate if someone could help me out with this!

Thanks in advance,
David

p.s. if you are able to help me have formatting in the email (like bold)
that would also be a bonus, but not required.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Hot to get line break in macro generated email

Have you tried vbCrLf in place of chr(13) chr(10)

vb carriage return line feed
--
HTH...

Jim Thomlinson


"Shanx" wrote:

Sorry if this has been asked before?
I haven't been able to find a thread that discusses this topic.

I have a macro which auto-generates emails using the following code:
______
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)

With OutMail
.To = recipient
.cc = manager
.BCC = ""
.Subject = "Reminder of Training/Certification Renewal"
.HTMLbody = EmailText
.Send '.display
End With
Set OutMail = Nothing
Set OutApp = Nothing
Application.ScreenUpdating = True
______

To create my email body (.HTMLbody = EmailText), i have a bunch of looped
code which generated some canned email message based on certain conditions in
my spreadsheet. I basically do so like this:
______
EmailText = EmailText & Chr(13) & "Your training/certification:"
...
...
EmailText = EmailText & Chr(13) & "It is your responsibility to arrange for
any renewal/recertification required. Please speak with your line manager for
approval of any training or re-training initiatives."
______

I am using Chr(13) {or alternatively Chr(10)} to try and create linebreaks
in my email. However, neither of these functions will generate an email with
line breaks (or carriage returns). I just end up with a continuous set of
text with a space in place of my line breaks.

All of my other code is working flawlessly generating my email, i just need
it to have proper line breaks.
I would really appreciate if someone could help me out with this!

Thanks in advance,
David

p.s. if you are able to help me have formatting in the email (like bold)
that would also be a bonus, but not required.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Hot to get line break in macro generated email (SOLVED)

I had also tried vrCrLf, but just forgot to mention it as it was the original
thing I had tried.

I have figured out now that the text in am inputing into .HTMLbody is being
treated as HTML code (duh!!!)
So I have been able to solve my problem by using <p</p & <br/ for line
breaks (paragraphs) and <b </b for bold

Thank you for the quick response :)
David

"Jim Thomlinson" wrote:

Have you tried vbCrLf in place of chr(13) chr(10)

vb carriage return line feed
--
HTH...

Jim Thomlinson


"Shanx" wrote:

Sorry if this has been asked before?
I haven't been able to find a thread that discusses this topic.

I have a macro which auto-generates emails using the following code:
______
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)

With OutMail
.To = recipient
.cc = manager
.BCC = ""
.Subject = "Reminder of Training/Certification Renewal"
.HTMLbody = EmailText
.Send '.display
End With
Set OutMail = Nothing
Set OutApp = Nothing
Application.ScreenUpdating = True
______

To create my email body (.HTMLbody = EmailText), i have a bunch of looped
code which generated some canned email message based on certain conditions in
my spreadsheet. I basically do so like this:
______
EmailText = EmailText & Chr(13) & "Your training/certification:"
...
...
EmailText = EmailText & Chr(13) & "It is your responsibility to arrange for
any renewal/recertification required. Please speak with your line manager for
approval of any training or re-training initiatives."
______

I am using Chr(13) {or alternatively Chr(10)} to try and create linebreaks
in my email. However, neither of these functions will generate an email with
line breaks (or carriage returns). I just end up with a continuous set of
text with a space in place of my line breaks.

All of my other code is working flawlessly generating my email, i just need
it to have proper line breaks.
I would really appreciate if someone could help me out with this!

Thanks in advance,
David

p.s. if you are able to help me have formatting in the email (like bold)
that would also be a bonus, but not required.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically generated email from Excel Ross[_10_] Excel Programming 2 April 2nd 08 01:34 PM
Break cell into multiple lines by line break Chia Excel Discussion (Misc queries) 1 August 20th 06 06:37 AM
Copy the body of an existing email in new emails generated via Excel with VBA. [email protected] Excel Programming 0 February 21st 06 09:17 PM
"Insert Line Break-Macro" vernerv Excel Programming 10 February 19th 04 01:56 PM
"Insert Line Break-Macro"-Thanks Bob, but.. vernerv[_4_] Excel Programming 1 February 18th 04 02:18 PM


All times are GMT +1. The time now is 06:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"