newline character 
Author Message
 newline character

Hello,

I've been able to open this file and display the data in a TextBox I've put
on a Form.

    cmdOpenFile.ShowOpen
    intFile = FreeFile
    Open cmdOpenFile.FileName For Input As intFile
    txtNoteBook.Text = Input(LOF(intFile), intFile)
    Close #intFile

But the TextBox doesn't recognize the newline character (|).  And I'm at a
lost how to handle these myself.

<example cut...> ecticut\|USA:Massachusetts\|USA:New Hampshire\|USA: <.....
end example>

I'd like this to display in my TextBox like so....

ecticut\ 'newline character handled quietly and gracefully
USA:Massachusetts\
USA:New Hampshire\
USA:

Word seems to understand the newline character, but Notepad does not.  Any
pointers?

Cheers--
John Choi



Fri, 15 Nov 2002 03:00:00 GMT  
 newline character
Hi John:

Quote:
> But the TextBox doesn't recognize the newline character (|).  And I'm at a
> lost how to handle these myself.

You can use the Replace method to change the single newline char to vbCrLf.
I would recommend two steps:

1.  Replace all current vbCrLf cominations with the single newline char.
2.  Replace all single newline chars with vbCrLf
3.  Assign the text to the textbox.

Hope this helps,

--
Doug Marquardt
(Visual Basic MVP)
http://support.microsoft.com/support/mvp/



Mon, 18 Nov 2002 03:00:00 GMT  
 newline character
do you have the multiline property set to True?
Quote:

>Hello,

>I've been able to open this file and display the data in a TextBox I've put
>on a Form.

>    cmdOpenFile.ShowOpen
>    intFile = FreeFile
>    Open cmdOpenFile.FileName For Input As intFile
>    txtNoteBook.Text = Input(LOF(intFile), intFile)
>    Close #intFile

>But the TextBox doesn't recognize the newline character (|).  And I'm at a
>lost how to handle these myself.

><example cut...> ecticut\|USA:Massachusetts\|USA:New Hampshire\|USA: <.....
>end example>

>I'd like this to display in my TextBox like so....

>ecticut\ 'newline character handled quietly and gracefully
>USA:Massachusetts\
>USA:New Hampshire\
>USA:

>Word seems to understand the newline character, but Notepad does not.  Any
>pointers?

>Cheers--
>John Choi



Sun, 08 Dec 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. HELP! NewLine Character

2. Is it possible to use VB to delete newline characters in a Word document

3. Newline Characters

4. How to put in a newline character?

5. Q: Newline character and textboxes

6. newline characters in VBScript

7. newline character in text object

8. Reading a large file that does not have newline characters

9. How to put in a newline character?

10. How to replace the weird paragraph character for a regular newline?

11. Why does the vbCrLf character get printed instead of an actual newline????

12. Removing newlines and tabs from textfield input

 

 
Powered by phpBB® Forum Software