I am having a problem writing to a text file without having quotes round my strings. The help files talk about print# statement but it doesn't seem to work. What am I doing wrong.
Printable View
I am having a problem writing to a text file without having quotes round my strings. The help files talk about print# statement but it doesn't seem to work. What am I doing wrong.
try this
Open "c:\yourfile.txt" for Output as #1
print #1, "this is a string"
print #1, """this is a string""" ' will have quotes
Close #1
If you want quotes around your strings, you can use write.
Dim sString as string
sString = "This is my text"
Write #1, sString
would put "This is my text" (in quotes) in your file. Using the Write statement put's quotes around strings, #'s around dates, and signifies boolean data by #TRUE# or #FALSE#. The Write statement also comma-delimits your data.