G
Greg
Word VBA Help gives the following example for the EOF function.
Sub Test()
Dim InputData
Open "MYFILE" For Input As #1 ' Open file for input.
Do While Not EOF(1) ' Check for end of file.
Line Input #1, InputData ' Read line of data.
Debug.Print InputData ' Print to the Immediate window.
Loop
Close #1 ' Close file.
End Sub
When I try to run this test, I get an error file not found. How do I
indentify the location of "MYFILE" in the code above? Thanks.
Sub Test()
Dim InputData
Open "MYFILE" For Input As #1 ' Open file for input.
Do While Not EOF(1) ' Check for end of file.
Line Input #1, InputData ' Read line of data.
Debug.Print InputData ' Print to the Immediate window.
Loop
Close #1 ' Close file.
End Sub
When I try to run this test, I get an error file not found. How do I
indentify the location of "MYFILE" in the code above? Thanks.