怎样得到richtextbox中每一行字符串?
怎样得到richtextbox中每一行字符串?(一行一行的)
并把他保存到一变量中
Set wordobj = New Word.Application '创建一WORD实例
On Error Resume Next
' Str_Diff = " ,;:?!. " + Chr(13) + Chr(10)
Str_Diff = Chr(13) + Chr(10)
Len_S = Len(RichTextBox1.Text)
Start = 1
While Start < Len_S
struc = " "
i = 0
j = 0
'判断一行的首位置
While (Start + i) <= Len_S And Mid(RichTextBox1.Text, Start + i, 1) = " "
i = i + 1
Wend
'判断一行的长度
While (Start + i + j) <= Len_S And InStr(1, Str_Diff, Mid(RichTextBox1.Text, Start + i + j, 1), vbBinaryCompare) <= 0
j = j + 1
Wend
'截取一行出来
struc = Mid(RichTextBox1.Text, Start + i, j)
处理文章如下(部分):
part Two
READINGIC ENTERED ACTIVITIES
qn-Class q延ading
Pre-Reading
Directions:Work in groups to discuss whether you would give your time,yourfavorite(最
喜欢的)books,your money,or your blood to
1)afriend;
2)a stranger.
Passage Reading
但还是不对?
只能取出第一行(part Two),其他的全是空(“”)的啦?
[解决办法]
帮顶一下~~貌似我也要用到这个啊。。研究中。。
[解决办法]
http://www.cnpopsoft.com/article.asp?id=18
[解决办法]
如何得到RichTextBox中中第N行的文本