Share via

Exporting Variable Text from Access

Anonymous
2012-04-21T00:17:52+00:00

I would like to have Access VBA create a file called "c:\mystuff\AccessOutput.txt" using the ready-to-go text in the string variable called "Text2Export".

Of course, if there is already a file with that name, I'd like this file to replace the old one.

This is just text going into a plain ASCII "txt" file.

How is that done?

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2012-04-21T00:30:03+00:00

Dim intFile As Integer

  intFile = FreeFile()

  Open "C:\mystuff\AccessOutput.txt" For Output As #intFile

  Print #intFile, Text2Export

  Close #intFile

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful