回车在文本框中 [英] carriage return in a text box

查看:72
本文介绍了回车在文本框中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的数据库允许用户通过CDO发送电子邮件。电子邮件的正文是用代码确定的
。我已经构建了一个包含To,CC和Subject

行的电子邮件表单和一个用于邮件正文的大文本框,以便用户可以编辑默认的电子邮件正文
在发送消息之前。


但是当我填充大文本框(txtBody)时,我无法得到

包括回车。我试过vbNewLine,vbCrLf,Chr(10)

和Chr(13)。我已将文本格式设置为Rich Text并输入

关键行为为新行字段。没有帮助。


是否可以使用VBA填充Access中的文本框,以便

将包含回车?

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?

推荐答案

evenlater写道:
evenlater wrote:

我的数据库允许用户通过CDO发送电子邮件。电子邮件的正文是用代码确定的
。我已经构建了一个包含To,CC和Subject

行的电子邮件表单和一个用于邮件正文的大文本框,以便用户可以编辑默认的电子邮件正文
在发送消息之前。


但是当我填充大文本框(txtBody)时,我无法得到

包括回车。我试过vbNewLine,vbCrLf,Chr(10)

和Chr(13)。我已将文本格式设置为Rich Text并输入

关键行为为新行字段。没有帮助。


是否可以使用VBA填充Access中的文本框,以便

将包含回车符?
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?



-----开始PGP签名消息-----

哈希:SHA1


使用TextBox的After Update事件程序添加vbCrLf:


如果不是IsNull(Me!txtBody)那么

如果正确

-----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然后

Me!txtBody = Me!txtBody& vbCrLf

结束如果

结束如果


-

MGFoster ::: mgf00< atearthlink< decimal-pointnet

奥克兰,加利福尼亚州(美国)

**仅回复此新闻组。我不回复电子邮件**


----- BEGIN PGP SIGNATURE -----

版本:个人隐私5.0的PGP

Charset:noconv


iQA / AwUBSNCKaIechKqOuFEgEQIfyACcC2UZ7b1pKkHg26WxjAAc0A 7GexsAnjDX

Wm5g0 / Np9BmoCj4OyS35D68d

= GriS

-----结束PGP SIGNATURE -----
(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-----


我不确定这会怎么样?我正在使用Form_Load事件将消息的主体

插入txtBody ...这并没有触发

txtBody_AfterUpdate,所以回车不会''添加到

用户编辑文本框。我希望那里的马车返回

即时表格打开。

9月16日,11:41 * pm,MGFoster< m ... @ privacy.comwrote:
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写道:
evenlater wrote:

我的数据库允许用户通过CDO发送电子邮件。电子邮件的正文是用代码确定的
。我已经构建了一个包含To,CC和Subject

行的电子邮件表单和一个用于邮件正文的大文本框,以便用户可以编辑默认的电子邮件正文
在发送消息之前。
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.


但是当我填充大文本框(txtBody)时,我无法得到它

包括回车。我试过vbNewLine,vbCrLf,Chr(10)

和Chr(13)。我已将文本格式设置为Rich Text并输入

关键行为为新行字段。没有帮助。
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.


是否可以使用VBA填充Access中的文本框,以便

将包含回车符?
Is it possible to populate a text box in Access with VBA so that it
will include carriage returns?



-----开始PGP签名消息-----

哈希:SHA1


使用TextBox的After Update事件程序添加vbCrLf:


* *如果不是IsNull(Me!txtBody)那么

* * *如果正确


-----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


这篇关于回车在文本框中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆