My db allows the user to send email via CDO. The body of the email is
determined in code. I have built an email form with To, CC and Subject
lines and a large text box for the body of the message so the user can
edit the default email message body before sending the message.
But when I populate the large text box (txtBody), I can't get it to
include the carriage returns. I've tried vbNewLine, vbCrLf, Chr(10)
and Chr(13). I've got the Text Format set to "Rich Text" and the Enter
Key Behavior to "New Line in Field". Doesn't help.
Is it possible to populate a text box in Access with VBA so that it
will include carriage returns? 11 12538
evenlater wrote:
My db allows the user to send email via CDO. The body of the email is
determined in code. I have built an email form with To, CC and Subject
lines and a large text box for the body of the message so the user can
edit the default email message body before sending the message.
But when I populate the large text box (txtBody), I can't get it to
include the carriage returns. I've tried vbNewLine, vbCrLf, Chr(10)
and Chr(13). I've got the Text Format set to "Rich Text" and the Enter
Key Behavior to "New Line in Field". Doesn't help.
Is it possible to populate a text box in Access with VBA so that it
will include carriage returns?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Use the TextBox's After Update event procedure to add the vbCrLf:
If Not IsNull(Me!txtBody) then
If Right$(Me!txtBody,2) <vbCrLf Then
Me!txtBody = Me!txtBody & vbCrLf
End If
End If
--
MGFoster:::mgf00 <atearthlink <decimal-pointnet
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBSNCKaIechKqOuFEgEQIfyACcC2UZ7b1pKkHg26WxjAAc0A 7GexsAnjDX
Wm5g0/Np9BmoCj4OyS35D68d
=GriS
-----END PGP SIGNATURE-----
I'm not sure how that would work? I'm plugging the body of the message
into txtBody using the Form_Load event... that doesn't trigger
txtBody_AfterUpdate, so the carriage returns wouldn't be added until
the user edited the text box. I want the carriage returns there the
instant the form opens.
On Sep 16, 11:41*pm, MGFoster <m...@privacy.comwrote:
evenlater wrote:
My db allows the user to send email via CDO. The body of the email is
determined in code. I have built an email form with To, CC and Subject
lines and a large text box for the body of the message so the user can
edit the default email message body before sending the message.
But when I populate the large text box (txtBody), I can't get it to
include the carriage returns. I've tried vbNewLine, vbCrLf, Chr(10)
and Chr(13). I've got the Text Format set to "Rich Text" and the Enter
Key Behavior to "New Line in Field". Doesn't help.
Is it possible to populate a text box in Access with VBA so that it
will include carriage returns?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Use the TextBox's After Update event procedure to add the vbCrLf:
* *If Not IsNull(Me!txtBody) then
* * *If Right$(Me!txtBody,2) <vbCrLf Then
* * * *Me!txtBody = Me!txtBody & vbCrLf
* * *End If
* *End If
--
MGFoster:::mgf00 <atearthlink <decimal-pointnet
Oakland, CA (USA)
** Respond only to this newsgroup. *I DO NOT respond to emails **
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBSNCKaIechKqOuFEgEQIfyACcC2UZ7b1pKkHg26WxjAAc0A 7GexsAnjDX
Wm5g0/Np9BmoCj4OyS35D68d
=GriS
-----END PGP SIGNATURE-----
evenlater wrote:
I'm not sure how that would work? I'm plugging the body of the message
into txtBody using the Form_Load event... that doesn't trigger
txtBody_AfterUpdate, so the carriage returns wouldn't be added until
the user edited the text box. I want the carriage returns there the
instant the form opens.
Can't you just call the AfterUpdate event in the OnLoad sub?
Me.Txt = Me.Txt & vbNewLine
Call Txt_AfterUpdate
>
On Sep 16, 11:41 pm, MGFoster <m...@privacy.comwrote:
>>evenlater wrote:
>>>My db allows the user to send email via CDO. The body of the email is determined in code. I have built an email form with To, CC and Subject lines and a large text box for the body of the message so the user can edit the default email message body before sending the message.
>>>But when I populate the large text box (txtBody), I can't get it to include the carriage returns. I've tried vbNewLine, vbCrLf, Chr(10) and Chr(13). I've got the Text Format set to "Rich Text" and the Enter Key Behavior to "New Line in Field". Doesn't help.
>>>Is it possible to populate a text box in Access with VBA so that it will include carriage returns?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Use the TextBox's After Update event procedure to add the vbCrLf:
If Not IsNull(Me!txtBody) then If Right$(Me!txtBody,2) <vbCrLf Then Me!txtBody = Me!txtBody & vbCrLf End If End If
-- MGFoster:::mgf00 <atearthlink <decimal-pointnet Oakland, CA (USA) ** Respond only to this newsgroup. I DO NOT respond to emails **
-----BEGIN PGP SIGNATURE----- Version: PGP for Personal Privacy 5.0 Charset: noconv
iQA/AwUBSNCKaIechKqOuFEgEQIfyACcC2UZ7b1pKkHg26WxjAAc0A 7GexsAnjDX Wm5g0/Np9BmoCj4OyS35D68d =GriS -----END PGP SIGNATURE-----
No, that doesn't work. And it doesn't work to try to add the new line
in the OnLoad event. It'll plug in text, but not a carriage return.
This is puzzling to me... surely there must be others who've used an
Access form to send an email message?
On Sep 17, 1:46*pm, Salad <o...@vinegar.comwrote:
evenlater wrote:
I'm not sure how that would work? I'm plugging the body of the message
into txtBody using the Form_Load event... that doesn't trigger
txtBody_AfterUpdate, so the carriage returns wouldn't be added until
the user edited the text box. I want the carriage returns there the
instant the form opens.
Can't you just call the AfterUpdate event in the OnLoad sub?
Me.Txt = Me.Txt & vbNewLine
Call Txt_AfterUpdate
On Sep 16, 11:41 pm, MGFoster <m...@privacy.comwrote:
>evenlater wrote:
>>My db allows the user to send email via CDO. The body of the email is determined in code. I have built an email form with To, CC and Subject lines and a large text box for the body of the message so the user can edit the default email message body before sending the message.
>>But when I populate the large text box (txtBody), I can't get it to include the carriage returns. I've tried vbNewLine, vbCrLf, Chr(10) and Chr(13). I've got the Text Format set to "Rich Text" and the Enter Key Behavior to "New Line in Field". Doesn't help.
>>Is it possible to populate a text box in Access with VBA so that it will include carriage returns?
>-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
>Use the TextBox's After Update event procedure to add the vbCrLf:
* If Not IsNull(Me!txtBody) then
* * If Right$(Me!txtBody,2) <vbCrLf Then
* * * Me!txtBody = Me!txtBody & vbCrLf
* * End If
* End If
>-- MGFoster:::mgf00 <atearthlink <decimal-pointnet Oakland, CA (USA) ** Respond only to this newsgroup. *I DO NOT respond to emails **
>-----BEGIN PGP SIGNATURE----- Version: PGP for Personal Privacy 5.0 Charset: noconv
>iQA/AwUBSNCKaIechKqOuFEgEQIfyACcC2UZ7b1pKkHg26WxjAAc0A 7GexsAnjDX Wm5g0/Np9BmoCj4OyS35D68d =GriS -----END PGP SIGNATURE-----
evenlater wrote:
No, that doesn't work. And it doesn't work to try to add the new line
in the OnLoad event. It'll plug in text, but not a carriage return.
This is puzzling to me... surely there must be others who've used an
Access form to send an email message?
I have.
I just created a form with an unbound text box (Text0), set the
EnterKeyBehavior to New Line in Field and have this OnLoad event code.
Private Sub Form_Load()
Me.Text0 = "This" & vbNewLine & "Is" & _
vbNewLine & "A" & vbNewLine & "Test"
End Sub
It works as expected. Then again, my message body is plain text.
>
On Sep 17, 1:46 pm, Salad <o...@vinegar.comwrote:
>>evenlater wrote:
>>>I'm not sure how that would work? I'm plugging the body of the message into txtBody using the Form_Load event... that doesn't trigger txtBody_AfterUpdate, so the carriage returns wouldn't be added until the user edited the text box. I want the carriage returns there the instant the form opens.
Can't you just call the AfterUpdate event in the OnLoad sub?
Me.Txt = Me.Txt & vbNewLine Call Txt_AfterUpdate
>>>On Sep 16, 11:41 pm, MGFoster <m...@privacy.comwrote:
>>>>evenlater wrote:
>>>>>My db allows the user to send email via CDO. The body of the email is >determined in code. I have built an email form with To, CC and Subject >lines and a large text box for the body of the message so the user can >edit the default email message body before sending the message.
>>>>>But when I populate the large text box (txtBody), I can't get it to >include the carriage returns. I've tried vbNewLine, vbCrLf, Chr(10) >and Chr(13). I've got the Text Format set to "Rich Text" and the Enter >Key Behavior to "New Line in Field". Doesn't help.
>>>>>Is it possible to populate a text box in Access with VBA so that it >will include carriage returns?
>>>>-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
>>>>Use the TextBox's After Update event procedure to add the vbCrLf:
>>> If Not IsNull(Me!txtBody) then If Right$(Me!txtBody,2) <vbCrLf Then Me!txtBody = Me!txtBody & vbCrLf End If End If
>>>>-- MGFoster:::mgf00 <atearthlink <decimal-pointnet Oakland, CA (USA) ** Respond only to this newsgroup. I DO NOT respond to emails **
>>>>-----BEGIN PGP SIGNATURE----- Version: PGP for Personal Privacy 5.0 Charset: noconv
>>>>iQA/AwUBSNCKaIechKqOuFEgEQIfyACcC2UZ7b1pKkHg26WxjAAc0A 7GexsAnjDX Wm5g0/Np9BmoCj4OyS35D68d =GriS -----END PGP SIGNATURE-----
I tried your code and it still doesn't work for me. It plugs in the
text, but not the carriage returns (i.e., "This is a Test"). What
version of Access are you using?
On Sep 17, 2:34*pm, Salad <o...@vinegar.comwrote:
evenlater wrote:
No, that doesn't work. And it doesn't work to try to add the new line
in the OnLoad event. It'll plug in text, but not a carriage return.
This is puzzling to me... surely there must be others who've used an
Access form to send an email message?
I have.
I just created a form with an unbound text box (Text0), set the
EnterKeyBehavior to New Line in Field and have this OnLoad event code.
* * * * Private Sub Form_Load()
* * * * * * * * Me.Text0 = "This" & vbNewLine & "Is" & _
* * * * * * * * * * * * vbNewLine & "A" & vbNewLine & "Test"
* * * * End Sub
It works as expected. *Then again, my message body is plain text.
On Sep 17, 1:46 pm, Salad <o...@vinegar.comwrote:
>evenlater wrote:
>>I'm not sure how that would work? I'm plugging the body of the message into txtBody using the Form_Load event... that doesn't trigger txtBody_AfterUpdate, so the carriage returns wouldn't be added until the user edited the text box. I want the carriage returns there the instant the form opens.
>Can't you just call the AfterUpdate event in the OnLoad sub?
>Me.Txt = Me.Txt & vbNewLine Call Txt_AfterUpdate
>>On Sep 16, 11:41 pm, MGFoster <m...@privacy.comwrote:
>>>evenlater wrote:
>>>>My db allows the user to send email via CDO. The body of the email is determined in code. I have built an email form with To, CC and Subject lines and a large text box for the body of the message so the user can edit the default email message body before sending the message.
>>>>But when I populate the large text box (txtBody), I can't get it to include the carriage returns. I've tried vbNewLine, vbCrLf, Chr(10) and Chr(13). I've got the Text Format set to "Rich Text" and the Enter Key Behavior to "New Line in Field". Doesn't help.
>>>>Is it possible to populate a text box in Access with VBA so that it will include carriage returns?
>>>-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
>>>Use the TextBox's After Update event procedure to add the vbCrLf:
>>*If Not IsNull(Me!txtBody) then * *If Right$(Me!txtBody,2) <vbCrLf Then * * *Me!txtBody = Me!txtBody & vbCrLf * *End If *End If
>>>-- MGFoster:::mgf00 <atearthlink <decimal-pointnet Oakland, CA (USA) ** Respond only to this newsgroup. *I DO NOT respond to emails **
>>>-----BEGIN PGP SIGNATURE----- Version: PGP for Personal Privacy 5.0 Charset: noconv
>>>iQA/AwUBSNCKaIechKqOuFEgEQIfyACcC2UZ7b1pKkHg26WxjAAc0A 7GexsAnjDX Wm5g0/Np9BmoCj4OyS35D68d =GriS -----END PGP SIGNATURE-----
evenlater wrote:
I tried your code and it still doesn't work for me. It plugs in the
text, but not the carriage returns (i.e., "This is a Test"). What
version of Access are you using?
97 and 2003. Both have the same results. You mentioned you had a text
box formated as Rich Text, however you did that. Maybe that's the
difference. Mine is a straight forward text box, no bells or whistles,
with the EnterKeyBehavior allowing NewLine.
>
On Sep 17, 2:34 pm, Salad <o...@vinegar.comwrote:
>>evenlater wrote:
>>>No, that doesn't work. And it doesn't work to try to add the new line in the OnLoad event. It'll plug in text, but not a carriage return. This is puzzling to me... surely there must be others who've used an Access form to send an email message?
I have.
I just created a form with an unbound text box (Text0), set the EnterKeyBehavior to New Line in Field and have this OnLoad event code. Private Sub Form_Load() Me.Text0 = "This" & vbNewLine & "Is" & _ vbNewLine & "A" & vbNewLine & "Test" End Sub It works as expected. Then again, my message body is plain text.
>>>On Sep 17, 1:46 pm, Salad <o...@vinegar.comwrote:
>>>>evenlater wrote:
>>>>>I'm not sure how that would work? I'm plugging the body of the message >into txtBody using the Form_Load event... that doesn't trigger >txtBody_AfterUpdate, so the carriage returns wouldn't be added until >the user edited the text box. I want the carriage returns there the >instant the form opens.
>>>>Can't you just call the AfterUpdate event in the OnLoad sub?
>>>>Me.Txt = Me.Txt & vbNewLine Call Txt_AfterUpdate
>>>>>On Sep 16, 11:41 pm, MGFoster <m...@privacy.comwrote:
>>>>>>evenlater wrote:
>>>>>>>My db allows the user to send email via CDO. The body of the email is >>>determined in code. I have built an email form with To, CC and Subject >>>lines and a large text box for the body of the message so the user can >>>edit the default email message body before sending the message.
>>>>>>>But when I populate the large text box (txtBody), I can't get it to >>>include the carriage returns. I've tried vbNewLine, vbCrLf, Chr(10) >>>and Chr(13). I've got the Text Format set to "Rich Text" and the Enter >>>Key Behavior to "New Line in Field". Doesn't help.
>>>>>>>Is it possible to populate a text box in Access with VBA so that it >>>will include carriage returns?
>>>>>>-----BEGIN PGP SIGNED MESSAGE----- >>Hash: SHA1
>>>>>>Use the TextBox's After Update event procedure to add the vbCrLf:
>>>>>If Not IsNull(Me!txtBody) then > If Right$(Me!txtBody,2) <vbCrLf Then > Me!txtBody = Me!txtBody & vbCrLf > End If >End If
>>>>>>-- >>MGFoster:::mgf00 <atearthlink <decimal-pointnet >>Oakland, CA (USA) >>** Respond only to this newsgroup. I DO NOT respond to emails **
>>>>>>-----BEGIN PGP SIGNATURE----- >>Version: PGP for Personal Privacy 5.0 >>Charset: noconv
>>>>>>iQA/AwUBSNCKaIechKqOuFEgEQIfyACcC2UZ7b1pKkHg26WxjAAc0A 7GexsAnjDX >>Wm5g0/Np9BmoCj4OyS35D68d >>=GriS >>-----END PGP SIGNATURE-----
Bingo! I had to change the text box TextFormat property back to Plain
Text and use .TextBody in my CDO code instead of .HTMLBody.
Salad, you're a life saver.
On Sep 17, 4:26*pm, Salad <o...@vinegar.comwrote:
evenlater wrote:
I tried your code and it still doesn't work for me. It plugs in the
text, but not the carriage returns (i.e., "This is a Test"). What
version of Access are you using?
97 and 2003. *Both have the same results. *You mentioned you had a text
box formated as Rich Text, however you did that. *Maybe that's the
difference. *Mine is a straight forward text box, no bells or whistles,
with the EnterKeyBehavior allowing NewLine.
On Sep 17, 2:34 pm, Salad <o...@vinegar.comwrote:
>evenlater wrote:
>>No, that doesn't work. And it doesn't work to try to add the new line in the OnLoad event. It'll plug in text, but not a carriage return. This is puzzling to me... surely there must be others who've used an Access form to send an email message?
>I have.
>I just created a form with an unbound text box (Text0), set the EnterKeyBehavior to New Line in Field and have this OnLoad event code.
* * * *Private Sub Form_Load()
* * * * * * * *Me.Text0 = "This" & vbNewLine & "Is" & _
* * * * * * * * * * * *vbNewLine & "A" & vbNewLine & "Test"
* * * *End Sub It works as expected. *Then again, my message body is plain text.
>>On Sep 17, 1:46 pm, Salad <o...@vinegar.comwrote:
>>>evenlater wrote:
>>>>I'm not sure how that would work? I'm plugging the body of the message into txtBody using the Form_Load event... that doesn't trigger txtBody_AfterUpdate, so the carriage returns wouldn't be added until the user edited the text box. I want the carriage returns there the instant the form opens.
>>>Can't you just call the AfterUpdate event in the OnLoad sub?
>>>Me.Txt = Me.Txt & vbNewLine Call Txt_AfterUpdate
>>>>On Sep 16, 11:41 pm, MGFoster <m...@privacy.comwrote:
>>>>>evenlater wrote:
>>>>>>My db allows the user to send email via CDO. The body of the emailis >>determined in code. I have built an email form with To, CC and Subject >>lines and a large text box for the body of the message so the usercan >>edit the default email message body before sending the message.
>>>>>>But when I populate the large text box (txtBody), I can't get it to >>include the carriage returns. I've tried vbNewLine, vbCrLf, Chr(10) >>and Chr(13). I've got the Text Format set to "Rich Text" and the Enter >>Key Behavior to "New Line in Field". Doesn't help.
>>>>>>Is it possible to populate a text box in Access with VBA so that it >>will include carriage returns?
>>>>>-----BEGIN PGP SIGNED MESSAGE----- >Hash: SHA1
>>>>>Use the TextBox's After Update event procedure to add the vbCrLf:
>>>>If Not IsNull(Me!txtBody) then * If Right$(Me!txtBody,2) <vbCrLf Then * * Me!txtBody = Me!txtBody & vbCrLf * End If End If
>>>>>-- >MGFoster:::mgf00 <atearthlink <decimal-pointnet >Oakland, CA (USA) >** Respond only to this newsgroup. *I DO NOT respond to emails **
>>>>>-----BEGIN PGP SIGNATURE----- >Version: PGP for Personal Privacy 5.0 >Charset: noconv
>>>>>iQA/AwUBSNCKaIechKqOuFEgEQIfyACcC2UZ7b1pKkHg26WxjAAc0A 7GexsAnjDX >Wm5g0/Np9BmoCj4OyS35D68d >=GriS >-----END PGP SIGNATURE-----
evenlater wrote:
Bingo! I had to change the text box TextFormat property back to Plain
Text and use .TextBody in my CDO code instead of .HTMLBody.
Salad, you're a life saver.
You are welcome.
I don't know what a TextFormat property is. Are you using A2007?
>
On Sep 17, 4:26 pm, Salad <o...@vinegar.comwrote:
>>evenlater wrote:
>>>I tried your code and it still doesn't work for me. It plugs in the text, but not the carriage returns (i.e., "This is a Test"). What version of Access are you using?
97 and 2003. Both have the same results. You mentioned you had a text box formated as Rich Text, however you did that. Maybe that's the difference. Mine is a straight forward text box, no bells or whistles, with the EnterKeyBehavior allowing NewLine.
>>>On Sep 17, 2:34 pm, Salad <o...@vinegar.comwrote:
>>>>evenlater wrote:
>>>>>No, that doesn't work. And it doesn't work to try to add the new line >in the OnLoad event. It'll plug in text, but not a carriage return. >This is puzzling to me... surely there must be others who've used an >Access form to send an email message?
>>>>I have.
>>>>I just created a form with an unbound text box (Text0), set the EnterKeyBehavior to New Line in Field and have this OnLoad event code. Private Sub Form_Load() Me.Text0 = "This" & vbNewLine & "Is" & _ vbNewLine & "A" & vbNewLine & "Test" End Sub It works as expected. Then again, my message body is plain text.
>>>>>On Sep 17, 1:46 pm, Salad <o...@vinegar.comwrote:
>>>>>>evenlater wrote:
>>>>>>>I'm not sure how that would work? I'm plugging the body of the message >>>into txtBody using the Form_Load event... that doesn't trigger >>>txtBody_AfterUpdate, so the carriage returns wouldn't be added until >>>the user edited the text box. I want the carriage returns there the >>>instant the form opens.
>>>>>>Can't you just call the AfterUpdate event in the OnLoad sub?
>>>>>>Me.Txt = Me.Txt & vbNewLine >>Call Txt_AfterUpdate
>>>>>>>On Sep 16, 11:41 pm, MGFoster <m...@privacy.comwrote:
>>>>>>>>evenlater wrote:
>>>>>>>>>My db allows the user to send email via CDO. The body of the email is >>>>>determined in code. I have built an email form with To, CC and Subject >>>>>lines and a large text box for the body of the message so the user can >>>>>edit the default email message body before sending the message.
>>>>>>>>>But when I populate the large text box (txtBody), I can't get it to >>>>>include the carriage returns. I've tried vbNewLine, vbCrLf, Chr(10) >>>>>and Chr(13). I've got the Text Format set to "Rich Text" and the Enter >>>>>Key Behavior to "New Line in Field". Doesn't help.
>>>>>>>>>Is it possible to populate a text box in Access with VBA so that it >>>>>will include carriage returns?
>>>>>>>>-----BEGIN PGP SIGNED MESSAGE----- >>>>Hash: SHA1
>>>>>>>>Use the TextBox's After Update event procedure to add the vbCrLf:
>>>>>>>>If Not IsNull(Me!txtBody) then >>> If Right$(Me!txtBody,2) <vbCrLf Then >>> Me!txtBody = Me!txtBody & vbCrLf >>> End If >>>>End If
>>>>>>>>-- >>>>MGFoster:::mgf00 <atearthlink <decimal-pointnet >>>>Oakland, CA (USA) >>>>** Respond only to this newsgroup. I DO NOT respond to emails **
>>>>>>>>-----BEGIN PGP SIGNATURE----- >>>>Version: PGP for Personal Privacy 5.0 >>>>Charset: noconv
>>>>>>>>iQA/AwUBSNCKaIechKqOuFEgEQIfyACcC2UZ7b1pKkHg26WxjAAc0A 7GexsAnjDX >>>>Wm5g0/Np9BmoCj4OyS35D68d >>>>=GriS >>>>-----END PGP SIGNATURE-----
Yes, I'm using 2007 and Text Format is a new property with the new
version. Honestly, I'm not really sure what it's used for. All Access
Help has to say about it is that it "gets or sets whether rich text is
displayed in the specified text box."
On Sep 17, 5:50*pm, Salad <o...@vinegar.comwrote:
evenlater wrote:
Bingo! I had to change the text box TextFormat property back to Plain
Text and use .TextBody in my CDO code instead of .HTMLBody.
Salad, you're a life saver.
You are welcome.
I don't know what a TextFormat property is. *Are you using A2007?
On Sep 17, 4:26 pm, Salad <o...@vinegar.comwrote:
>evenlater wrote:
>>I tried your code and it still doesn't work for me. It plugs in the text, but not the carriage returns (i.e., "This is a Test"). What version of Access are you using?
>97 and 2003. *Both have the same results. *You mentioned you had a text box formated as Rich Text, however you did that. *Maybe that's the difference. *Mine is a straight forward text box, no bells or whistles, with the EnterKeyBehavior allowing NewLine.
>>On Sep 17, 2:34 pm, Salad <o...@vinegar.comwrote:
>>>evenlater wrote:
>>>>No, that doesn't work. And it doesn't work to try to add the new line in the OnLoad event. It'll plug in text, but not a carriage return. This is puzzling to me... surely there must be others who've used an Access form to send an email message?
>>>I have.
>>>I just created a form with an unbound text box (Text0), set the EnterKeyBehavior to New Line in Field and have this OnLoad event code.. * * * Private Sub Form_Load() * * * * * * * Me.Text0 = "This" & vbNewLine & "Is" &_ * * * * * * * * * * * vbNewLine & "A" & vbNewLine & "Test" * * * End Sub It works as expected. *Then again, my message body is plain text.
>>>>On Sep 17, 1:46 pm, Salad <o...@vinegar.comwrote:
>>>>>evenlater wrote:
>>>>>>I'm not sure how that would work? I'm plugging the body of the message >>into txtBody using the Form_Load event... that doesn't trigger >>txtBody_AfterUpdate, so the carriage returns wouldn't be added until >>the user edited the text box. I want the carriage returns there the >>instant the form opens.
>>>>>Can't you just call the AfterUpdate event in the OnLoad sub?
>>>>>Me.Txt = Me.Txt & vbNewLine >Call Txt_AfterUpdate
>>>>>>On Sep 16, 11:41 pm, MGFoster <m...@privacy.comwrote:
>>>>>>>evenlater wrote:
>>>>>>>>My db allows the user to send email via CDO. The body of the email is >>>>determined in code. I have built an email form with To, CC and Subject >>>>lines and a large text box for the body of the message so the user can >>>>edit the default email message body before sending the message.
>>>>>>>>But when I populate the large text box (txtBody), I can't get itto >>>>include the carriage returns. I've tried vbNewLine, vbCrLf, Chr(10) >>>>and Chr(13). I've got the Text Format set to "Rich Text" and theEnter >>>>Key Behavior to "New Line in Field". Doesn't help.
>>>>>>>>Is it possible to populate a text box in Access with VBA so thatit >>>>will include carriage returns?
>>>>>>>-----BEGIN PGP SIGNED MESSAGE----- >>>Hash: SHA1
>>>>>>>Use the TextBox's After Update event procedure to add the vbCrLf:
>>>>>>>If Not IsNull(Me!txtBody) then >>*If Right$(Me!txtBody,2) <vbCrLf Then >>* *Me!txtBody = Me!txtBody & vbCrLf >>*End If >>>End If
>>>>>>>-- >>>MGFoster:::mgf00 <atearthlink <decimal-pointnet >>>Oakland, CA (USA) >>>** Respond only to this newsgroup. *I DO NOT respond to emails **
>>>>>>>-----BEGIN PGP SIGNATURE----- >>>Version: PGP for Personal Privacy 5.0 >>>Charset: noconv
>>>>>>>iQA/AwUBSNCKaIechKqOuFEgEQIfyACcC2UZ7b1pKkHg26WxjAAc0A 7GexsAnjDX >>>Wm5g0/Np9BmoCj4OyS35D68d >>>=GriS >>>-----END PGP SIGNATURE-----
evenlater wrote:
Yes, I'm using 2007 and Text Format is a new property with the new
version. Honestly, I'm not really sure what it's used for. All Access
Help has to say about it is that it "gets or sets whether rich text is
displayed in the specified text box."
Thanks for the update. I believe with RFT you can do boldings and
underlines and other formatting of text. Most likely it was the HTLM
part that didn't accept the newlines. If you created a file like
This
is
a
test
and saved it as HTML and opened it in a browser it looks like
This is a test
Anyway, glad you got the thing to work.
>
On Sep 17, 5:50 pm, Salad <o...@vinegar.comwrote:
>>evenlater wrote:
>>>Bingo! I had to change the text box TextFormat property back to Plain Text and use .TextBody in my CDO code instead of .HTMLBody. Salad, you're a life saver.
You are welcome.
I don't know what a TextFormat property is. Are you using A2007?
>>>On Sep 17, 4:26 pm, Salad <o...@vinegar.comwrote:
>>>>evenlater wrote:
>>>>>I tried your code and it still doesn't work for me. It plugs in the >text, but not the carriage returns (i.e., "This is a Test"). What >version of Access are you using?
>>>>97 and 2003. Both have the same results. You mentioned you had a text box formated as Rich Text, however you did that. Maybe that's the difference. Mine is a straight forward text box, no bells or whistles, with the EnterKeyBehavior allowing NewLine.
>>>>>On Sep 17, 2:34 pm, Salad <o...@vinegar.comwrote:
>>>>>>evenlater wrote:
>>>>>>>No, that doesn't work. And it doesn't work to try to add the new line >>>in the OnLoad event. It'll plug in text, but not a carriage return. >>>This is puzzling to me... surely there must be others who've used an >>>Access form to send an email message?
>>>>>>I have.
>>>>>>I just created a form with an unbound text box (Text0), set the >>EnterKeyBehavior to New Line in Field and have this OnLoad event code. > Private Sub Form_Load() > Me.Text0 = "This" & vbNewLine & "Is" & _ > vbNewLine & "A" & vbNewLine & "Test" > End Sub >>It works as expected. Then again, my message body is plain text.
>>>>>>>On Sep 17, 1:46 pm, Salad <o...@vinegar.comwrote:
>>>>>>>>evenlater wrote:
>>>>>>>>>I'm not sure how that would work? I'm plugging the body of the message >>>>>into txtBody using the Form_Load event... that doesn't trigger >>>>>txtBody_AfterUpdate, so the carriage returns wouldn't be added until >>>>>the user edited the text box. I want the carriage returns there the >>>>>instant the form opens.
>>>>>>>>Can't you just call the AfterUpdate event in the OnLoad sub?
>>>>>>>>Me.Txt = Me.Txt & vbNewLine >>>>Call Txt_AfterUpdate
>>>>>>>>>On Sep 16, 11:41 pm, MGFoster <m...@privacy.comwrote:
>>>>>>>>>>evenlater wrote:
>>>>>>>>>>>My db allows the user to send email via CDO. The body of the email is >>>>>>>determined in code. I have built an email form with To, CC and Subject >>>>>>>lines and a large text box for the body of the message so the user can >>>>>>>edit the default email message body before sending the message.
>>>>>>>>>>>But when I populate the large text box (txtBody), I can't get it to >>>>>>>include the carriage returns. I've tried vbNewLine, vbCrLf, Chr(10) >>>>>>>and Chr(13). I've got the Text Format set to "Rich Text" and the Enter >>>>>>>Key Behavior to "New Line in Field". Doesn't help.
>>>>>>>>>>>Is it possible to populate a text box in Access with VBA so that it >>>>>>>will include carriage returns?
>>>>>>>>>>-----BEGIN PGP SIGNED MESSAGE----- >>>>>>Hash: SHA1
>>>>>>>>>>Use the TextBox's After Update event procedure to add the vbCrLf:
>>>>>>>>>>If Not IsNull(Me!txtBody) then >>>>>If Right$(Me!txtBody,2) <vbCrLf Then >>>>> Me!txtBody = Me!txtBody & vbCrLf >>>>>End If >>>>>>End If
>>>>>>>>>>-- >>>>>>MGFoster:::mgf00 <atearthlink <decimal-pointnet >>>>>>Oakland, CA (USA) >>>>>>** Respond only to this newsgroup. I DO NOT respond to emails **
>>>>>>>>>>-----BEGIN PGP SIGNATURE----- >>>>>>Version: PGP for Personal Privacy 5.0 >>>>>>Charset: noconv
>>>>>>>>>>iQA/AwUBSNCKaIechKqOuFEgEQIfyACcC2UZ7b1pKkHg26WxjAAc0A 7GexsAnjDX >>>>>>Wm5g0/Np9BmoCj4OyS35D68d >>>>>>=GriS >>>>>>-----END PGP SIGNATURE-----
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Canes_Rock |
last post by:
The information posted at:
...
|
by: Lauren Quantrell |
last post by:
I have created the following trigger:
CREATE TRIGGER ON OutputTable
FOR INSERT
AS
Declare @filename nvarchar(35)
Declare @filecontents nvarchar(2000)
Declare @strcmdshell varchar(150)
|
by: Paradigm |
last post by:
I want to insert a carriage return into a text field. I am using insert into
and \n for newline. The MYSQL database is accessed by a MS Access front end
and the text field appears with a small...
|
by: J.Marsch |
last post by:
I am having a problem in which ASP.Net web services are corrupting my data.
I know that my problem is related to the standard way of encoding carriage
return linefeeds, so I need to figure out how...
|
by: dancer |
last post by:
Using ASP.Net and VB.net
I have textboxes (<asp:textbox id......>) in which the user will be entering
paragraphs.
They are multiline (several rows and several columns).
The carriage returns...
|
by: whitej77777 |
last post by:
I am trying to write a user defined function that will allow me to
strip off the last carriage return and line feed from a text field.
We have address fields stored in a text field for our ERP...
|
by: Bobby |
last post by:
Hi
I'm trying to export some data from an Access table to Sage Line 50
using VBA. It works fine, except that very occasionally one of the
fields contains a carriage return. If I step through my...
|
by: nur123 |
last post by:
Thanks in advance who will look at it.
I have been encountering an issue which I can’t find a way out of it.
What my pgm does:
It (java codes) reads oracle table data and creates flat text...
|
by: LOCAFO |
last post by:
I am using vb.net and have a long string of text. When I use vbnewline or vbCrLf, for a carraige retun, I get a black square box in the SQL database table. I need the carriage return but I don't...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |