Hi all,
I try to read file from file..
i put the file at drive D:\test.txt
Please help me..
Thanks.
Best Regards
Hi all,
I try to read file from file..
i put the file at drive D:\test.txt
Please help me..
Thanks.
Best Regards
There are many way to accomplish this.
See if this help :
' Get a free file number
nFileNum = FreeFile
' Open a text file for input. inputbox returns the path to read the file
Open "D:\test.txt" For Input As nFileNum
lLineCount = 1
' Read the contents of the file
Do While Not EOF(nFileNum)
Line Input #nFileNum, sNextLine
'do something with it
'add line numbers to it, in this case!
sNextLine = sNextLine & vbCrLf
sText = sText & sNextLine
Loop
Text1.Text = sText
' Close the file
Close nFileNum
Thank you very much for your quick help..
and also solved this thread.
Thank you.
You're welcome friend..
Happy coding.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.