|
-
Sep 10th, 2000, 03:24 AM
#1
Thread Starter
Lively Member
I want to import a .txt file into a TextBox, how???
Open C:\text.txt For Input As #1
Line Input #1, Form1.Text1.Text
Close #1
Like that?
Thanks
___________________________
Chris
-
Sep 10th, 2000, 04:13 AM
#2
Fanatic Member
Code:
Dim Line As String
Open C:\text.txt For Input As #1
Do
Line Input #1, Line
Form1.Text1.Text = Form1.Text1.Text & vbcrlf & Line
Loop Until EOF(1)
Close #1
-
Sep 10th, 2000, 05:12 AM
#3
Thread Starter
Lively Member
Uhm, actually oetje, that code didnt work when there were lines in the text file.
I.e.
Blah1Blah1Blah1
Blah2Blah2Blah2
Would be displayed as:
Blah1Blah1Blah1||Blah2Blah2Blah2
___________________________
Chris
-
Sep 10th, 2000, 05:34 AM
#4
Monday Morning Lunatic
Set the Text Box's Multiline property to True.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Sep 10th, 2000, 07:06 AM
#5
_______
<?>
Code:
'read the complete file instead of line by line
'faster and cleaner
Option Explicit
Private Sub Command1_Click()
Dim sfile As String, intNum As Integer
intNum = FreeFile
sfile = "C:\my Documents\myfile.txt"
Open sfile For Input As intNum
Text1 = StrConv(InputB(LOF(intNum), intNum), vbUnicode)
Close intNum
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Sep 10th, 2000, 10:59 AM
#6
Code:
Open "MyFile.txt" For Input As #1
Text1 = Input(LOF(1), 1)
Close #1
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|