Carriage Returns in text boxes & Outlook?

  • Thread starter Thread starter Jay
  • Start date Start date
J

Jay

Hi,

I've set up the facility for a user to create an email from a database.
It doesn't send it but just opens it in Outlook. The body of the email
is determined by a text box which contains some actual text and [fields].

However, no matter how I set out the text in the text box it is dumped
into Outlook as consecutive text. Ideally I'd like to be have a blank
line or two between the two sentences in the text box. (and for these to
be carried into Outlook)

Is there any way I can do this? Some way of putting a hard carriage
return within the text box which will be recognised when the text is
dumped into the email body.

Sorry if I've not been clear.

If anyone could help I'd be really grateful.

Many thanks,

Jason
 
Hi Jay

Try this

Some text here & Chr(13)+Chr(10) some more text

This will give you

Some text here
some more text
 
Or, in VBA code, you can use vbCrLf instead of Chr(13) & Chr(10) (In
queries, you must use the Chr function calls)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Wayne-I-M said:
Hi Jay

Try this

Some text here & Chr(13)+Chr(10) some more text

This will give you

Some text here
some more text


--
Wayne
Manchester, England.
Enjoy whatever it is you do


Jay said:
Hi,

I've set up the facility for a user to create an email from a database.
It doesn't send it but just opens it in Outlook. The body of the email
is determined by a text box which contains some actual text and [fields].

However, no matter how I set out the text in the text box it is dumped
into Outlook as consecutive text. Ideally I'd like to be have a blank
line or two between the two sentences in the text box. (and for these to
be carried into Outlook)

Is there any way I can do this? Some way of putting a hard carriage
return within the text box which will be recognised when the text is
dumped into the email body.

Sorry if I've not been clear.

If anyone could help I'd be really grateful.

Many thanks,

Jason
 
Douglas said:
Or, in VBA code, you can use vbCrLf instead of Chr(13) & Chr(10) (In
queries, you must use the Chr function calls)

Many thanks for both suggestions. I appreciate it.

Jason
 
Douglas said:
Or, in VBA code, you can use vbCrLf instead of Chr(13) & Chr(10) (In
queries, you must use the Chr function calls)
Thanks for the advice. I appreciate your time.

Jason
 
Wayne,

I used the character function calls as you suggested. It inserts a return
into my actual text box, but for some reason it still transfers to Outlook
as consecutive text. I'm using the following code to shove it into an email:
Private Sub cboOpenOutlook_Click()
On Error GoTo Error_Handler

Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem

Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)

With objEmail
.BodyFormat = olFormatRichText
.To = Me.txtEmailAddress
.CC = Me.txtCCEmailAddress
.Subject = Me.txtEmailSubject
.HTMLBody = Me.txtMessageText
'.attachments.Add "c:\Path\to\the\next\file.txt"
.Display
'.ReadReceiptRequested
End With

Exit_Here:
Set objOutlook = Nothing
Exit Sub

Error_Handler:
MsgBox Err & ": " & Err.Description
Resume Exit_Here

End Sub

Where Subject = Me.txtEmailSubject relates to the txt box containing the
Chr function calls?

Any advice you could offer would be great.

Thanks
Jay


Wayne-I-M said:
Hi Jay

Try this

Some text here & Chr(13)+Chr(10) some more text

This will give you

Some text here
some more text


--
Wayne
Manchester, England.
Enjoy whatever it is you do


Jay said:
Hi,

I've set up the facility for a user to create an email from a database.
It doesn't send it but just opens it in Outlook. The body of the email
is determined by a text box which contains some actual text and [fields].

However, no matter how I set out the text in the text box it is dumped
into Outlook as consecutive text. Ideally I'd like to be have a blank
line or two between the two sentences in the text box. (and for these to
be carried into Outlook)

Is there any way I can do this? Some way of putting a hard carriage
return within the text box which will be recognised when the text is
dumped into the email body.

Sorry if I've not been clear.

If anyone could help I'd be really grateful.

Many thanks,

Jason
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top