This code opens a text file called "myname.txt" located in the C drive, reads each line of the file one by one, and displays it in a message box until it reaches the end of the file. It uses the FileSystemObject to open the text file, a Do loop to iterate through each line, and the ReadLine method to extract and display the text line by line.
This code opens a text file called "myname.txt" located in the C drive, reads each line of the file one by one, and displays it in a message box until it reaches the end of the file. It uses the FileSystemObject to open the text file, a Do loop to iterate through each line, and the ReadLine method to extract and display the text line by line.
Copyright:
Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online from Scribd
This code opens a text file called "myname.txt" located in the C drive, reads each line of the file one by one, and displays it in a message box until it reaches the end of the file. It uses the FileSystemObject to open the text file, a Do loop to iterate through each line, and the ReadLine method to extract and display the text line by line.
Copyright:
Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online from Scribd
set fso = createobject("scripting.filesystemobject") set text = fso.opentextfile("C:myname.txt",1,true) do while text.atendofstream <> true msgbox text.