Create text file Access VBA

I need to be able to write text to a text file. I am trying it with the VBA open file append. But when I write to file it puts double quote on the ends of the line. Does anyone have a solution where I can write the text with no quotes?
LVL 1
IdaracAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

IrogSintaCommented:
Try using PRINT instead of WRITE.  The latter add quotation marks around strings.
0
Luke ChungPresidentCommented:
How about something like this:

Public Function CreateFileFromText(strFileName As String, strText As String) As Boolean
  ' Comments: Create (save) a file containing the text you provide
  ' Params  : strFileName           File name to create (including full path)
  '           strText               Text to put into the file
  ' Returns : True if successful, False if not
  ' Source  : Total Visual SourceBook
  
  On Error GoTo PROC_ERR
  
  Dim intFile As Integer
  
  ' Assume failure
  CreateFileFromText = False
  
  intFile = FreeFile
  Open strFileName For Output As #intFile
  Print #intFile, strText
  Close #intFile
  CreateFileFromText = True
  
PROC_EXIT:
  Exit Function
  
PROC_ERR:
  MsgBox "Error: " & Err.Number & ". " & Err.Description, , "modFileDisk.CreateFileFromText"
  Resume PROC_EXIT
End Function

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
IdaracAuthor Commented:
Thank you both
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.