Dzony
06-14-2016, 03:16 AM
Hi
I have code like this below. I recieve from it first line of text from file "Myfile.docm" but opened with notepad. How I can work with this line? How to get words or characters from it?
Private Sub Test_OpenTxt()
Dim strFilename As String: strFilename = "C:\Myfilepath\Myfile.docm"
Dim strTextLine As String
Dim iFile As Integer: iFile = FreeFile
Open strFilename For Input As #iFile
Do Until EOF(1)
Line Input #1, strTextLine
Debug.Print "strTextLine : " & " " & strTextLine
Loop
Close #iFile
End Sub
I have code like this below. I recieve from it first line of text from file "Myfile.docm" but opened with notepad. How I can work with this line? How to get words or characters from it?
Private Sub Test_OpenTxt()
Dim strFilename As String: strFilename = "C:\Myfilepath\Myfile.docm"
Dim strTextLine As String
Dim iFile As Integer: iFile = FreeFile
Open strFilename For Input As #iFile
Do Until EOF(1)
Line Input #1, strTextLine
Debug.Print "strTextLine : " & " " & strTextLine
Loop
Close #iFile
End Sub