I try to read file from file..
i put the file at drive D:\test.txt
Please help me..
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.
You're welcome friend..
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.