Writing text file

J

John

Hi

When I write a string in a text file using below code my strings are
enclosed in double quotes. How can I avoid the quotes and get just the text?

Thanks

Regards

St = "My String"
Open "MyFile.txt" For Append As #1
Write #1, St
Close #1
 
K

Ken Snell [MVP]

Use Print method instead:

St = "My String"
Open "MyFile.txt" For Append As #1
Print #1, St
Close #1
 
J

John W. Vinson

Hi

When I write a string in a text file using below code my strings are
enclosed in double quotes. How can I avoid the quotes and get just the text?

Thanks

Regards

St = "My String"
Open "MyFile.txt" For Append As #1
Write #1, St
Close #1

Use Print #1 instead of Write #1. See the VBA help for the two methods.
 
B

Bob Quintal

Hi

When I write a string in a text file using below code my strings
are enclosed in double quotes. How can I avoid the quotes and get
just the text?

Thanks

Regards

St = "My String"
Open "MyFile.txt" For Append As #1
Write #1, St
Close #1

Try Print #1, st instead of write.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top