|
-
Nov 12th, 2000, 06:59 PM
#1
Thread Starter
Hyperactive Member
How can I open a file and insert its contents into a TextBox?
thx, vbzero
-
Nov 12th, 2000, 07:02 PM
#2
_______
<?>
Code:
'Open a file in binary mode and read into a textbox or string
Dim sHolder As String
Dim intNum As Integer
Dim sFileName As String
'open for binary and read
sFileName = "C:\My Documents\MyFile.txt"
intNum = FreeFile
Open sFileName For Binary As intNum
sHolder = Space(LOF(1))
Get #1, , sHolder
Close intNum
'assign the text to a textbox
Text1 = sHolder ' for a string (strString = sholder)
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Nov 12th, 2000, 07:04 PM
#3
Thread Starter
Hyperactive Member
-
Nov 12th, 2000, 07:20 PM
#4
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
|