I am trying to open a file with notepad.
const strfilename = \"C:\\Users\\Desktop\\abc.txt\"
set OFS = myOFSO.OpenTextFile(strfilename)
I
If you want to create a new text-file and want to write into it, you could use this approach:
Sub writeToTextFile()
Dim i As Long
Open ThisWorkbook.Path & "\newFile.txt" For Output As #1
Print #1, "This could be the first line"
Print #1, "this the second"
For i = 3 To 10
Print #1, "this is the " & i & ". line"
Next
Close #1
End Sub