Re: Textbox Question



if you need to add two spaces after a full stop then add
this line at the end of the loop
Text1.Text = Replace(Text1.Text, ". ", ". ")


Private Sub Command1_Click()
Do Until InStr(Text1.Text, " ") = 0
Text1.Text = Replace(Text1.Text, " ", " ")
Loop
Text1.Text = Replace(Text1.Text, ". ", ". ")

Do Until InStr(Text1.Text, vbCrLf & vbCrLf) = 0
Text1.Text = Replace(Text1.Text, vbCrLf & vbCrLf, vbCrLf)
Loop

End Sub

Private Sub Form_Load()
Text1.Text = " " & "test" & vbCrLf & vbCrLf & vbCrLf & " " & "test" &
vbCrLf & vbCrLf & vbCrLf
End Sub



"TedF" <NoReply@xxxxxxxxxx> wrote in message
news:%23296AbDCGHA.3920@xxxxxxxxxxxxxxxxxxxxxxx
> Private Sub Command1_Click()
> Do Until InStr(Text1.Text, " ") = 0
> Text1.Text = Replace(Text1.Text, " ", " ")
> Loop
> Do Until InStr(Text1.Text, vbCrLf & vbCrLf) = 0
> Text1.Text = Replace(Text1.Text, vbCrLf & vbCrLf, vbCrLf)
> Loop
> End Sub
>
> Private Sub Form_Load()
> Text1.Text = " " & "test" & vbCrLf & vbCrLf & vbCrLf & " " & "test" &
> vbCrLf & vbCrLf & vbCrLf
> End Sub
>
>
> <Johnny@xxxxxxx> wrote in message
> news:uk6pq1p0bhvqo6grl3g950uqqngsmhcmi9@xxxxxxxxxx
>> This should be easy but I am having difficulty. Say I have a text box
>> with a buch of text. The text could include double spaces as well as
>> multple vbCRLF. Say I want to go to the tenth word, How do I do it.
>> I cannot use the instr command becasue words can appear an unknown
>> number of times. I tried using an array with split and " " but the
>> multiple double sppacing and the vbCRLF
>>
>> THANKS
>
>


.



Relevant Pages

  • Endless Loop
    ... > Private Sub cmdStart_Click ... why the form is left running when the form is told to unload. ... Form.Close will never close a form that holds an endless loop ... Private mbUnload As Boolean ...
    (microsoft.public.vb.general.discussion)
  • Endless Loop
    ... > Private Sub cmdStart_Click ... why the form is left running when the form is told to unload. ... Form.Close will never close a form that holds an endless loop ... Private mbUnload As Boolean ...
    (microsoft.public.vb.database)
  • Re: multiple xml imports from local path
    ... > Dirto loop through all the files in a folder. ... > Private Sub btnImportAllFiles_Click ... > Dim strfile As String ...
    (microsoft.public.access.externaldata)
  • Re: Stop Timer
    ... Private Sub cmdUntilLoop_Click ... Dim intPause As Integer ... MsgBox Timer ... A more elegant way is to have a public variable or control on the form that can be set from outside the loop, and that will be tested in each iteration of the loop to see if it's time to stop. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Search engin
    ... Private Sub find ... Loop While Not c Is Nothing And c.Address firstAddress ... MsgBox "Please note that there are no more entries avaliable" ...
    (microsoft.public.excel.programming)

Loading