Re: Writing to simple text file, get rid of quotes



Stop using Write # and start using Print # instead.

The VB help for the Write statement mentions: "Unlike the Print # statement,
the Write # statement inserts commas between items and quotation marks
around strings as they are written to the file."

The 'See Also' link points to the Print # statement.

--
Tim Rude

timrude@xxxxxxxxxxxxxxxxxx
(remove NOSPAM. for correct email address)

"Brian Wojo" <BrianWojo@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:25CC832D-801A-479D-948B-8C3EB9A5925B@xxxxxxxxxxxxxxxx
> When I write to a simple text file to create an ".INI" type file, I've
> noticed that VB automatically encloses everything with quotes (the
variable
> types I am using are strings). For example, an ".INI" file looks like:
> [SECTION HEADING]
> data1 = "string"
>
> When I use the Write command using a simple sequential file I attempt to
> write string variables to the file. For example my code looks like:
> Dim data as String
> Open path for Output As #1
> data = "[SECTION HEADING]"
> Write #1, data
>
> The problem is that all of the strings I output to the file are
> automatically enclosed in quotes, so the result of the sample code above
> write the text file like:
>
> "[SECTION HEADING]"
>
> Does anyone know how to output a string variable to a simple text file
> WITHOUT having the strings enclosed in quotes?


.